The MASM Forum

General => The Workshop => Topic started by: jj2007 on October 06, 2017, 12:15:23 PM

Title: Map viewer
Post by: jj2007 on October 06, 2017, 12:15:23 PM
Extract all files to a tmp folder, then start ArrayPlotMaps.exe and press F1 for help. So far tested on Win7-64 and XP. I am curious if it works on all systems ::)

Caution the maps are very old, I hope nobody is politically offended :bgrin:

The source is included (*.asc) but it won't build with the current MB version. The absolute minimum source would be as follows:
Code: [Select]
include \masm32\MasmBasic\Res\MbGui.asm
  GuiControl MyMap, "canvas"              ; create a dedicated new control ;-)
  GetFiles *.dmi
  ArrayLoadMap 0, Files$(0)

Event CanvasPaint
  ArrayPlot hWnd, RgbCol(100, 240, 255)         ; init with window (or control) handle and background colour
  PaintMap RgbCol(127, 127, 127), lines=2       ; display map with grey borders 2px thick
  ArrayPlot exit, "Map of "+Left$(Files$(0), Rinstr(Files$(0), ".")-1)       ; finish with a title

Event Message
  If_ uMsg==WM_MOUSEMOVE || uMsg==WM_LBUTTONDOWN Then <ArrayMapRegion(uMsg-WM_MOUSEMOVE)>         ; show tooltip
GuiEnd
Title: Re: Map viewer
Post by: sinsi on October 06, 2017, 12:23:27 PM
No indication of which part is currently selected (except by changing colour).
Name tooltip stays when changing map.
Where's Australia??? :biggrin:
Title: Re: Map viewer
Post by: jj2007 on October 06, 2017, 12:32:48 PM
No indication of which part is currently selected (except by changing colour).

This is by design 8)

Quote
Name tooltip stays when changing map.

Which Windows version? It changes on mine.

Quote
Where's Australia??? :biggrin:

Oops, corrected above. Oceania.dmi was included but .map was missing :icon_redface:
Title: Re: Map viewer
Post by: sinsi on October 06, 2017, 12:38:51 PM
Windows 10 Pro x64
Title: Re: Map viewer
Post by: jj2007 on October 06, 2017, 05:35:14 PM
Yep, I can reproduce that one on Win10-64 Home, and, with some luck, also on Win7-64. But it's only temporary, as soon as you move on to the next region, the correct name shows up. A non-issue imho but thanks for flagging it :icon14:

Will see if I find a "reset tooltips" command.
Title: Re: Map viewer
Post by: mikeburr on October 10, 2017, 01:12:38 PM
win 7 64   old HP keyboard [but quite feature rich]
map selection not working on mine [ie selection keys not working ]
could only get Africa ...the countries incidentally were not correct either ... where are   British Nyasaland ... Rhodesia ...Tanganika ???? etc 
tried various other methods of associating the DMI as well
couldn't run it under Linux/Wine either but thats not surprising ..
regards   mike b
Title: Re: Map viewer
Post by: jj2007 on October 10, 2017, 04:40:57 PM
where are   British Nyasaland ... Rhodesia ...Tanganika ???? etc

When I wrote "the maps are very old", I meant the year 2000, not 1900 :P
Title: Re: Map viewer
Post by: jj2007 on October 16, 2017, 05:14:22 AM
Version 2 attached, works with the maps above. Work in progress, the source is still too confused to be posted here :icon_redface:
Title: Re: Map viewer
Post by: felipe on October 16, 2017, 10:19:00 AM
i Get an error when tried to execute it:

FATAL ERROR:
Could not open
dmi
for Recall,FileRead$,etc.


 :icon_exclaim: Windows 8.1 64 bits...(Don't have masmbasic installed). I downloaded the last version (v2).
Title: Re: Map viewer
Post by: jj2007 on October 16, 2017, 02:47:09 PM
Could not open
dmi

works with the maps above.

I didn't want to post the maps twice. Extract them to the folder where the new exe sits.
Title: Re: Map viewer
Post by: felipe on October 17, 2017, 02:39:37 AM
 :t Pretty nice, all worked fine, but the left and right arrow to change the country seems like don't.
Title: Re: Map viewer
Post by: jj2007 on October 17, 2017, 05:07:30 AM
Thanks :P

I dropped the left-right thing because now you can select the country simply by clicking on it. Afterwards, the up-down arrays change the colour.

First post is updated with new version, including the source - 48 lines of code :biggrin: