Arsip Tag: Map Basic

belajar Map Basic.. (yang kedua..)

Map Basic

Wow.. Bulan yang lalu, kita udah kenalan sama Map Basic..
Sekarang, gw mo ngenalin agak lebih deket lagi sama Program Map Basic. Gimana kalo kita coba bikin menu di Map Info..!
Yup.. Loe sama sekali gak salah denger eh maksud gw elo gak salah baca.. Kita mau bikin Menu seperti menu yang berjejer di sudut kiri atas Map Info..

Pertama-tama, loe pelototin baris program dibawah:

==========================================================================
‘******************Sub Utama: Buat Menu utamanya
Sub Main

Create Menu “Filter by Network..” As
“(Show Network GSM” Calling GSM_Select,
“(Show Network DCS” Calling DCS_Select,
“(Show All Network” Calling Show_All

Create Menu “Calc Methode Select..” As
“(Use Calc Methode General” Calling Calc_Methode_General,
“(Use Calc Methode Global” Calling Calc_Methode_Global,
“(Use Calc Methode Cell” Calling Calc_Methode_Cell

Create Menu “NetSpidy” As
“Create New Project” Calling Createsub,
“Open Project” Calling Opensub,
“(Save Project” Calling Savesub,
“(Close Project” Calling Closesub,
“(-“,
“(Show Toolbox” Calling ShowToolboxsub,
“(-“,
“Calc Methode Select..” As “Calc Methode Select..”,
“Filter by Network..” As “Filter by Network..”,
“(Filter by BCCH” Calling Filter_BCCH,
“(Filter by Most TA” Calling Most_TA,
“(Search site” Calling Search_Site,
“(Clear Map” Calling ClearMap,
“(-“,
“Exit” Calling Exitsub,
“(-“,
“About” Calling Aboutsub

Alter Menu Bar Remove ID 6, ID 7
Alter Menu Bar Add “NetSpidy”, ID 6, ID 7
Alter Menu Bar Add “NetSpidy”, ID 6, ID 7

End Sub
===============================================================================

Ok, udah…?
Chk.. chk… Pelototin lagi…!

Ok, cukup..

Sekarang kita bahas baris demi baris.. Siap…?

Harusnya loe dah tau “procedure” ok..
Program diatas gw kasih nama procedurenya:

—> Sub Main

Didalamnya, ada perintah:
==========
—> Create Menu “Filter by Network..” As
“(Show Network GSM” Calling GSM_Select,
“(Show Network DCS” Calling DCS_Select,
“(Show All Network” Calling Show_All
==========
maksudnya:
Gw pengen bikin menu dengan nama +Filter by Network..+ dan didalamnya berisi pilihan menu Show Network GSM, Show Network DCS dan Show All Network.
Masing2 pilihan menu tadi, ketika kita “klik” ato pilih, akan memanggil procedure GSM_Select, DCS_Select dan Show_All. Jadi “Calling” artinya mememanggil procedure OK..
Tanda buka kurung “(” fungsinya untuk men-disable menu saat pertama muncul. Dan harus di-enable agar bisa di-“klik”.

=========
—> Create Menu “Calc Methode Select..” As
“(Use Calc Methode General” Calling Calc_Methode_General,
“(Use Calc Methode Global” Calling Calc_Methode_Global,
“(Use Calc Methode Cell” Calling Calc_Methode_Cell
=========
maksudnya:
Sama dengan keterangan sebelumnya..

=========
—> Create Menu “NetSpidy” As
“Create New Project” Calling Createsub,
“Open Project” Calling Opensub,
“(Save Project” Calling Savesub,
“(Close Project” Calling Closesub,
“(-“,
“(Show Toolbox” Calling ShowToolboxsub,
“(-“,
“Calc Methode Select..” As “Calc Methode Select..”,
“Filter by Network..” As “Filter by Network..”,
“(Filter by BCCH” Calling Filter_BCCH,
“(Filter by Most TA” Calling Most_TA,
“(Search site” Calling Search_Site,
“(Clear Map” Calling ClearMap,
“(-“,
“Exit” Calling Exitsub,
“(-“,
“About” Calling Aboutsub
==========
Maksudnya:
Sama dengan keterangan sebelum2-nya.Cuma ada tambahan tanda buka kurung dan minus “(-” .
Tanda tersebut untuk membuat garis pembatas pada menu yang akan ditampilkan. Garis Batas

Berguna untuk memisahkan pilihan2 menu berdasar kriteria tertentu…
Juga didalam menu diatas, gw buat “anak menu”. “Filter by Network..” adalah anak menu dari “NetSpidy”. Sehingga nanti, kalo gw klik, akan muncul pilihan2 menu selanjutnya.Anak Menu

==========
Alter Menu Bar Remove ID 6, ID 7
Alter Menu Bar Add “NetSpidy”, ID 6, ID 7
==========
maksudnya:
Buang Menu dengan ID 6 juga ID 7. Menu ID 6 itu: Window. Dan Menu ID 7 itu: Help.
Selanjutnya, tambahkan menu “NetSpidy”, baru kemudian ID 6 selanjutnya ID 7.
Fungsinya untuk meletakkan menu “NetSpidy” sebelum menu “window” dan menu “Help di Map Info.

=====
end sub
=====
Kalo ini elo gak tau, kebangetan…!

OK… Selese..
Loe bisa cobain sendiri. Copy baris program diatas ke MapBasic Editor. Jangan lupa, Procedure2 yang dipanggil pada baris progran diatas mesti dibuat juga di baris program elo. Kalo nggak, akan muncul error..

Maksud gw, kalo tadi ada baris : Calling Filter_BCCH
Berarti elo mesti bikin procedure:
====
Sub Filter_BCCH

End Sub
====

Loe kosongin isi procedurenya juga ga apa-apa.. Kan cuma testing…
OK…

Nah selamat mencoba…

🙂

Iklan