MAPPING
THE REGION - I notice some people write logbook program with
a map showing a station's location. I am not smart enough to design a hitech
digital map. So I decide to borrow some other people's map. I got those maps
from the internet.
I create a database with fields name a. Prefix or callsign b. Area / kawasan c. Country d. Coordinate X e. Coordinate Y.
I must first key in data; all prefixes and country name / area name. Enter these data in any way you want. You might to design data entry program or use access database etc.
I use 2 command button, a timer,several text boxes and an image control. Command1 button is resize to 2 X 2 cm. The timer is used to blink it.
If Command1.BackColor = QBColor(12) Then
Command1.BackColor = QBColor(0)
Else
Command1.BackColor = QBColor(12)
End If
The Menu Editor is used to list the maps.
Private Sub carib_Click()
neg = "caribean.gif"
Call Command2_Click
End Sub
Private Sub Command2_Click()
Image1 = LoadPicture("c:\ham1\" + neg + "")
Me.Width = Image1.Width
Me.Height = Image1.Height
End Sub
Command2 button merely load a map. Here the map is located in ham1 folder. You have to declare the neg. Window size is the map size. My intention is to record a place location. I use the coordinates on my screen map instead of the real world latitude and logitude. If I decide to map Southeast Asia then I have to put the map on using the pulldown menu. I look for a country. Say SAUDI ARABIA with prefix HZ. I click on Saudi Arabia's map. Command1 button will come to the point Ijust clicked. To record the corordinate, I just click on the command1 button.
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.Caption = "X=" & x & " Y=" & y
m = x: n = y
End Sub
Private Sub Image1_Click()
Command4.Left = m: Command4.Top = n : ' bring command1 button where it is
clicked
End Sub
Private Sub Command1_Click()
Text4 = m: Text5 = n : ' coordinates on the image is recorded
End Sub
DATA RETREIVAL - Now we want to retreive the data. We want to enter a callsign or prefix and we want it to show on the map. I use two modules namely lokasi.frm and peta.frm ( map ). This program is separate from the previous one.
Dim ada, last, prefix
|
![]() The coding on the left is not good. You have to do your own codings. Text2 is the yellow box above. As you type it will scan your database. If in your database you only have HZ for Saudi Arabia, once it is displayed in the text box below it, it will pass the country name to variable last and prefix to variable prefix. So if you enter HZ2, the variableassignments wil not proceed anymore unless you have HZ2 as a prefix in your database.
That's the whole coding for peta.frm. Notice the command button in black. It is actually blinking between red and black. |