Hello,
I like your code, but I have a little problem
sample code
Code: Select all
; TEST AND EXAMPLE CODE
XIncludeFile "rbutton_include.pbi"
OpenWindow(0, 100, 200, 290, 50, "rButton test window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
SetWindowColor(0, RGB(255, 255, 255))
rbutton_SetFont("Arial", 9, #PB_Font_Bold | #PB_Font_Italic, RGB(255,255,255), -120)
rbutton_Init_OwnerDrawn(80, 30, GetWindowColor(0), RGBA(214,236,255,255), RGBA(0,220,255,255), RGBA(255,255,255,255), RGBA(60,225,137,255),5, 2)
Define regSmall1.i = rbutton_Create(#PB_Any, 0, "open", 10, 10, 0)
Define regSmall2.i = rbutton_Create(#PB_Any, 0, "infos", 105, 10, 0)
rbutton_Init_OwnerDrawn(80, 30, GetWindowColor(0), RGBA(236,214,214,255), RGBA(191,120,120,255), RGBA(255,255,255,255), RGBA(225,60,60,255),5, 2)
Define regSmall3.i = rbutton_Create(#PB_Any, 0, "Quit", 200, 10, 0)
Define Quit.i = 0
Repeat
Define Event.i = WaitWindowEvent()
If Event.i = #PB_Event_CloseWindow ; If the user has pressed on the close button
Quit.i = 1
EndIf
If Event.i = #PB_Event_Gadget
If EventGadget() = regSmall1.i
File$ = OpenFileRequester("Chose a file", "C:\", "file txt|*.txt",1)
EndIf
If EventGadget() = regSmall2.i
MessageRequester("Infos","Dummy")
EndIf
If EventGadget() = regSmall3.i
Quit.i = 1
EndIf
EndIf
rbutton_CheckHover(0)
Until Quit.i = 1
End
first click the save button for example, opens the window OpenFileRequester, close the window and move the cursor over the save button but do not click, the window opens again OpenFileRequester .
for such info button with a window MessageRequester
test on Windows Seven, not tested with Linux
I'm forgetting something in the code?
thank you
sorry for my bad english