See WM_SIZE message.
Enable the update...
Code: Select all
;=========================================================
; PBDev - PureBasic Developer, 1.011, 2003-04-27, 12:30
;=========================================================
#PBD_EXE = 1
#FORM1 = "FORM1"
#ID_FORM1_TOOLBAR1 = 100
#ID_FORM1_STATUSBAR1 = 101
#IDM_FORM1_MENU_6755444 = 1000
Declare.l Form1_Callback( WindowID, Message, wParam, lParam )
Declare.l PBD_CreateForm( sFormName.s, pCallBack.l )
Declare.l PBD_Main()
PBD_Main()
End
Procedure.l Form1_Callback( WindowID, Message, wParam, lParam )
Protected nResult.l
nResult = #PB_ProcessPureBasicEvents
Select Message
Case #WM_SIZE
;>>>> problemmaker..
;UpdateStatusBar( #ID_FORM1_STATUSBAR1 )
Default
ProcedureReturn nResult
EndSelect
EndProcedure
Procedure.l PBD_Main()
Protected Quit.l ; End of form indicator
Protected EventID.l ; Message type
Protected WindowID.l ; hWnd
; The first form you want to show, evt. with callback
WindowID = PBD_CreateForm( #FORM1, @Form1_Callback() )
If WindowID
; Toolbar settings
ToolBarStandardButton( 1, #PB_ToolBarIcon_New )
ToolBarStandardButton( 2, #PB_ToolBarIcon_Open )
ToolBarStandardButton( 3, #PB_ToolBarIcon_Save )
ToolBarStandardButton( 4, #PB_ToolBarIcon_Print )
ToolBarStandardButton( 5, #PB_ToolBarIcon_Find )
ToolBarStandardButton( 6, #PB_ToolBarIcon_Replace )
ToolBarSeparator()
ToolBarStandardButton( 7, #PB_ToolBarIcon_Cut )
ToolBarStandardButton( 8, #PB_ToolBarIcon_Copy )
ToolBarStandardButton( 9, #PB_ToolBarIcon_Paste )
ToolBarStandardButton( 10, #PB_ToolBarIcon_Undo )
ToolBarStandardButton( 11, #PB_ToolBarIcon_Redo )
ToolBarSeparator()
ToolBarStandardButton( 12, #PB_ToolBarIcon_Delete )
ToolBarStandardButton( 13, #PB_ToolBarIcon_Properties )
ToolBarStandardButton( 14, #PB_ToolBarIcon_Help )
; Statusbar settings
AddStatusBarField( 100 )
StatusBarText( #ID_FORM1_STATUSBAR1, 0, "Field1" )
AddStatusBarField( 32768 )
StatusBarText( #ID_FORM1_STATUSBAR1, 1, "Field2" )
; Messageloop
Repeat
EventID = WaitWindowEvent()
; Message
Select EventID
Case #PB_EventMenu
MessageRequester( "Information", "ToolBar or Menu ID: " + Str( EventMenuID() ), 0 )
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
Else
ProcedureReturn = 1
EndIf
EndProcedure
Procedure.l PBD_CreateForm( sFormName.s, pCallBack.l )
Protected hWnd.l
sFormName = Trim( UCase( sFormName ) )
Select sFormName
Case #FORM1
hWnd = OpenWindow( 0, 264, 209, 490, 232, #PB_Window_SystemMenu | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_SizeGadget | #PB_Window_ScreenCentered, "Form1" )
If hWnd
If pCallBack
SetWindowCallback( pCallBack )
EndIf
If CreateMenu( 0, hWnd )
MenuTitle( "Menu 1" )
MenuItem( 1000, "Menu 1" )
EndIf
If CreateGadgetList( hWnd )
CreateToolBar( 100, hWnd )
CreateStatusBar( 101, hWnd )
EndIf
EndIf
EndSelect
ProcedureReturn hWnd
EndProcedureStrange looking html changed by Berikco

