hope BindEvent() supported more Event

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
gurj
Enthusiast
Enthusiast
Posts: 693
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

hope BindEvent() supported more Event

Post by gurj »

hope BindEvent() supported more Event,
Message events that want BindEvent() to support any 32-bit binary natural value.

Code: Select all

;TODO hope BindEvent() supported more Event

Procedure wm_systimer()
 Debug 1
EndProcedure

OpenWindow(0, 100, 100, 200, 200, "BindEventEx", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
EditorGadget(0, 10, 10, 180, 180)
#wm_systimer=280
BindEvent(#wm_systimer, @wm_systimer())
SetActiveGadget(0)
Repeat
 Event = WaitWindowEvent()
 If Event = #wm_systimer
  Debug 0
 EndIf
Until Event = #PB_Event_CloseWindow

Last edited by gurj on Fri Mar 01, 2019 6:53 pm, edited 1 time in total.
my pb for chinese:
http://ataorj.ys168.com
User avatar
Bisonte
Addict
Addict
Posts: 1305
Joined: Tue Oct 09, 2007 2:15 am

Re: hope BindEvent() supported more Event

Post by Bisonte »

MSDN wrote:The WM_SYSTIMER message is an undocumented message, it is used for caret blink. In fact, there is no the #define WM_SYSTIMER.
Why should it on PB ?
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
User avatar
gurj
Enthusiast
Enthusiast
Posts: 693
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: hope BindEvent() supported more Event

Post by gurj »

thanks Bisonte!
Sorry, updated the topic ...
my pb for chinese:
http://ataorj.ys168.com
User avatar
mk-soft
Always Here
Always Here
Posts: 6207
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: hope BindEvent() supported more Event

Post by mk-soft »

Code: Select all

;TODO hope BindEvent() supported more Event

Enumeration CustomEvents #PB_Event_FirstCustomValue
  #MyEvent_SysTimer
EndEnumeration

; ----

#wm_systimer = $118

Procedure WinCB(hWnd, uMsg, wParam, lParam)
  
  Select uMsg
    Case #wm_systimer
      PostEvent(#MyEvent_SysTimer)
  EndSelect
  
  ProcedureReturn #PB_ProcessPureBasicEvents 
  
EndProcedure

; ----

Procedure wm_systimer()
 Debug "MyEvent_SysTimer"
EndProcedure

SetWindowCallback(@WinCB())

OpenWindow(0, 100, 100, 200, 200, "BindEventEx", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
EditorGadget(0, 10, 10, 180, 180)
BindEvent(#MyEvent_SysTimer, @wm_systimer())
SetActiveGadget(0)

Repeat
 Event = WaitWindowEvent()
 If Event = #wm_systimer
  Debug 0
 EndIf
Until Event = #PB_Event_CloseWindow
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
gurj
Enthusiast
Enthusiast
Posts: 693
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: hope BindEvent() supported more Event

Post by gurj »

Thanks to mk-soft!
I've changed my mind now, though.
I guess the selection command is also used at the bottom of the BindEvent(), which is shoddy. I plan to use virtual tables and use GoTo directly.
See: viewtopic.php?f=12&t=71749
my pb for chinese:
http://ataorj.ys168.com
Post Reply