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:
28
osm.pb
28
osm.pb
@@ -749,7 +749,7 @@ Module OSM
|
||||
EndModule
|
||||
|
||||
|
||||
;Demonstration
|
||||
;-Exemple
|
||||
CompilerIf #PB_Compiler_IsMainFile
|
||||
Enumeration
|
||||
#Window_0
|
||||
@@ -781,8 +781,26 @@ Procedure UpdateLocation(*Location.Location)
|
||||
SetGadgetText(#String_1,StrD(*Location\Longitude))
|
||||
ProcedureReturn 0
|
||||
EndProcedure
|
||||
|
||||
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 )
|
||||
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()
|
||||
LoadFont(0, "Wingdings", 12)
|
||||
@@ -825,13 +843,15 @@ If OpenWindow(#Window_0, 260, 225, 700, 571, "OpenStreetMap", #PB_Window_System
|
||||
Case #Gdt_LoadGpx
|
||||
OSM::LoadGpxFile(OpenFileRequester("Choisissez un fichier à charger", "", "*.gpx", 0))
|
||||
EndSelect
|
||||
Case #PB_Event_SizeWindow
|
||||
ResizeAll()
|
||||
EndSelect
|
||||
Until Quit = #True
|
||||
EndIf
|
||||
CompilerEndIf
|
||||
; IDE Options = PureBasic 5.42 LTS (Windows - x86)
|
||||
; CursorPosition = 726
|
||||
; FirstLine = 683
|
||||
; CursorPosition = 749
|
||||
; FirstLine = 713
|
||||
; Folding = -----
|
||||
; EnableUnicode
|
||||
; EnableThread
|
||||
|
Reference in New Issue
Block a user