Ok been tinkering away at a win32 module and thought people might want to see. Im sure other peoples win32 modules are further alogn than this, but I have been working hard to develop a really powerfull, and easy module. Plus the fact there are alot of hurdles when first getting used to bmax.
Anyway: http://skn3.acsv.net/junk/win32max.rar The rar contains the module (no source included) plus an example file. It should be everythign to give it a try out.
The example program in the rar archive.
Import skn3.win32Max
'create gadget class
Global class:TGadgetClass = CreateGadgetClass("myclass",Null,0,0,COLOR_3DFACE+1)
'create gadgets
Global window:TGadget = CreateGadget("My window",500,5,600,400,class,0,WS_VISIBLE | WS_TILEDWINDOW | WS_SIZEBOX)
Global group:TGadget = CreateGadget("My group",5,5,500,300,"Button",window,WS_CHILD | WS_VISIBLE | BS_GROUPBOX | WS_CLIPCHILDREN)
Global button:TGadget = CreateGadget("My button",5,25,200,40,"Button",group,WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_CLIPCHILDREN)
'create some events
button.AddEvent(WM_LBUTTONUP)
button.AddEventCallBack(MyButtonCallback,WM_LBUTTONUP)
'main event loop
Repeat
Select WaitMessage()
Case WM_LBUTTONUP
Notify "Clicked button at x:"+eventx+" y:"+eventy
End Select
FlushMem()
Forever
'(advanced) event callbac
Function MyButtonCallback()
'This will be built into the basic button object, but is just show to display the flexability of the system.
Select eventid
Case WM_LBUTTONUP
'check mouse hit was in button
If ApiPtInRect(eventgadget.Rect(),eventx,eventy)
'we want to modify the eventx and eventy so they are local to the gadget rather than screen coords.
eventx = lparamX(eventlparam)
eventy = lparamY(eventlparam)
'allow event to return mouse click detected
Return False
Else
'stop event from returning
Return True
End If
End Select
End Function
This demonstrates the flexability of the module. The way inwhich gadget events happen can be designed within your bmax source code. (see MyButtonCallback() for example)
Anyway, tell me what you think. Bare in mind, there will be pre-designed gadget classes so you want have to deal with what is shown in the example.
|