new event types for BindGadgetEvent

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

new event types for BindGadgetEvent

Post by eddy »

Is it possible to have some new event types like: #PB_EventType_SizeGadget and #PB_EventType_FreeGadget ?

Code: Select all

Procedure CustomGadget(Gadget, x, y, w, h, scrollbarThickness=15)
   Protected *mygadget.CUSTOM_GADGET=AllocateMemory(SizeOf(CUSTOM_GADGET))
   With *mygadget
      Protected result=ContainerGadget(Gadget, 0, 0, 0, 0, #PB_Container_BorderLess)
      If Gadget=#PB_Any
         \gadget=result
      Else
         \gadget=Gadget
      EndIf
      ; YOUR CODE HERE
      CloseGadgetList()
      
      SetGadgetData(\container, *mygadget)      
      BindGadgetEvent(\container, @CustomGadget_Drawing(), #PB_EventType_SizeGadget )
      BindGadgetEvent(\container, @CustomGadget_FreeResourceAndMemory(), #PB_EventType_FreeGadget )
      
      ResizeGadget(\container, x, y, w, h)
      ProcedureReturn result
   EndWith    
EndProcedure
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
Bisonte
Addict
Addict
Posts: 1308
Joined: Tue Oct 09, 2007 2:15 am

Re: new event types for BindGadgetEvent

Post by Bisonte »

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.)
Post Reply