Add resize to Window Exemple
You can resize Window with Exemple and all gadget change his position function window size.
This commit is contained in:
62
osm.pb
62
osm.pb
@@ -236,17 +236,17 @@ Module OSM
|
|||||||
|
|
||||||
Global Proxy = #True
|
Global Proxy = #True
|
||||||
|
|
||||||
;- => Use this to customise your preferences
|
;- => Use this to customise your preferences
|
||||||
; Result = CreatePreferences(GetHomeDirectory() + "OSM.prefs")
|
; Result = CreatePreferences(GetHomeDirectory() + "OSM.prefs")
|
||||||
; If Proxy
|
; If Proxy
|
||||||
; PreferenceGroup("PROXY")
|
; PreferenceGroup("PROXY")
|
||||||
; WritePreferenceString("ProxyURL", "myproxy.fr")
|
; WritePreferenceString("ProxyURL", "myproxy.fr")
|
||||||
; WritePreferenceString("ProxyPort", "myproxyport")
|
; WritePreferenceString("ProxyPort", "myproxyport")
|
||||||
; WritePreferenceString("ProxyUser", "myproxyname")
|
; WritePreferenceString("ProxyUser", "myproxyname")
|
||||||
; EndIf
|
; EndIf
|
||||||
; If Result
|
; If Result
|
||||||
; ClosePreferences()
|
; ClosePreferences()
|
||||||
; EndIf
|
; EndIf
|
||||||
|
|
||||||
Result = OpenPreferences(GetHomeDirectory() + "OSM.prefs")
|
Result = OpenPreferences(GetHomeDirectory() + "OSM.prefs")
|
||||||
If Proxy
|
If Proxy
|
||||||
@@ -749,9 +749,9 @@ Module OSM
|
|||||||
EndModule
|
EndModule
|
||||||
|
|
||||||
|
|
||||||
;Demonstration
|
;-Exemple
|
||||||
CompilerIf #PB_Compiler_IsMainFile
|
CompilerIf #PB_Compiler_IsMainFile
|
||||||
Enumeration
|
Enumeration
|
||||||
#Window_0
|
#Window_0
|
||||||
#Map
|
#Map
|
||||||
#Button_0
|
#Button_0
|
||||||
@@ -769,20 +769,38 @@ Enumeration
|
|||||||
#String_0
|
#String_0
|
||||||
#String_1
|
#String_1
|
||||||
#Gdt_LoadGpx
|
#Gdt_LoadGpx
|
||||||
EndEnumeration
|
EndEnumeration
|
||||||
|
|
||||||
Structure Location
|
Structure Location
|
||||||
Longitude.d
|
Longitude.d
|
||||||
Latitude.d
|
Latitude.d
|
||||||
EndStructure
|
EndStructure
|
||||||
|
|
||||||
Procedure UpdateLocation(*Location.Location)
|
Procedure UpdateLocation(*Location.Location)
|
||||||
SetGadgetText(#String_0,StrD(*Location\Latitude))
|
SetGadgetText(#String_0,StrD(*Location\Latitude))
|
||||||
SetGadgetText(#String_1,StrD(*Location\Longitude))
|
SetGadgetText(#String_1,StrD(*Location\Longitude))
|
||||||
ProcedureReturn 0
|
ProcedureReturn 0
|
||||||
EndProcedure
|
EndProcedure
|
||||||
;- Main
|
|
||||||
If OpenWindow(#Window_0, 260, 225, 700, 571, "OpenStreetMap", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
|
Procedure ResizeAll()
|
||||||
|
ResizeGadget(#Map,10,10,WindowWidth(#Window_0)-198,WindowHeight(#Window_0)-59)
|
||||||
|
ResizeGadget(#Text_1,WindowWidth(#Window_0)-170,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#Button_0,WindowWidth(#Window_0)-150,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#Button_1,WindowWidth(#Window_0)-90,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#Button_2,WindowWidth(#Window_0)-110,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#Button_3,WindowWidth(#Window_0)-110,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#Text_2,WindowWidth(#Window_0)-170,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#Button_4,WindowWidth(#Window_0)-150,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#Button_5,WindowWidth(#Window_0)-100,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#Text_3,WindowWidth(#Window_0)-170,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#String_0,WindowWidth(#Window_0)-100,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#String_1,WindowWidth(#Window_0)-100,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#Text_4,WindowWidth(#Window_0)-170,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
ResizeGadget(#Gdt_LoadGpx,WindowWidth(#Window_0)-170,#PB_Ignore,#PB_Ignore,#PB_Ignore)
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
|
;- Main
|
||||||
|
If OpenWindow(#Window_0, 260, 225, 700, 571, "OpenStreetMap", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered | #PB_Window_SizeGadget )
|
||||||
|
|
||||||
OSM::InitOSM()
|
OSM::InitOSM()
|
||||||
LoadFont(0, "Wingdings", 12)
|
LoadFont(0, "Wingdings", 12)
|
||||||
@@ -825,13 +843,15 @@ If OpenWindow(#Window_0, 260, 225, 700, 571, "OpenStreetMap", #PB_Window_System
|
|||||||
Case #Gdt_LoadGpx
|
Case #Gdt_LoadGpx
|
||||||
OSM::LoadGpxFile(OpenFileRequester("Choisissez un fichier à charger", "", "*.gpx", 0))
|
OSM::LoadGpxFile(OpenFileRequester("Choisissez un fichier à charger", "", "*.gpx", 0))
|
||||||
EndSelect
|
EndSelect
|
||||||
|
Case #PB_Event_SizeWindow
|
||||||
|
ResizeAll()
|
||||||
EndSelect
|
EndSelect
|
||||||
Until Quit = #True
|
Until Quit = #True
|
||||||
EndIf
|
EndIf
|
||||||
CompilerEndIf
|
CompilerEndIf
|
||||||
; IDE Options = PureBasic 5.42 LTS (Windows - x86)
|
; IDE Options = PureBasic 5.42 LTS (Windows - x86)
|
||||||
; CursorPosition = 726
|
; CursorPosition = 749
|
||||||
; FirstLine = 683
|
; FirstLine = 713
|
||||||
; Folding = -----
|
; Folding = -----
|
||||||
; EnableUnicode
|
; EnableUnicode
|
||||||
; EnableThread
|
; EnableThread
|
||||||
|
Reference in New Issue
Block a user