Page 1 of 1
[Implemented] More beauty for Spin Gadget
Posted: Sun Sep 08, 2013 3:34 am
by Korolev Michael
Default Spin Gadget is awful.

OK, I made UpDown a little wider using SetWindowPos_.
MSDN says
Always make a spin control the "buddy" of the text box. Doing so places the spin control inside the text box.
So, how I can make spin control like this?
I tried to place UpDown control inside Text buddy, by using SetWindowPos_. But I can't align text to left in associated Text control. I began to suspect that I need to create my own SpinControl..
Re: More beauty for Spin Gadget
Posted: Sun Sep 08, 2013 3:54 am
by USCode
Seems like that should be the default look on Windows, much cleaner.
Should this be moved to be an enhancement request for Fred to set the AutoBuddy property to TRUE?
Re: More beauty for Spin Gadget
Posted: Sun Sep 08, 2013 4:07 am
by Korolev Michael
I found some solutions on this forum, but these are kind of dirty:
Code: Select all
#UDS_HOTTRACK = $0100
hMain=OpenWindow(0, 0, 0, 50, 50, "SpinGadget", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
hSpinField = StringGadget(0,20,20,42,20,"",#ES_LEFT|#PB_String_Numeric)
CreateUpDownControl_(#WS_CHILD|#WS_BORDER|#WS_VISIBLE|#UDS_ALIGNRIGHT|#UDS_SETBUDDYINT|#UDS_HOTTRACK|#UDS_ARROWKEYS,10,10,80,20,hMain,1,GetModuleHandle_(0),hSpinField,500,0,250)
SetGadgetAttribute(0, #PB_String_MaximumLength, 3)
Repeat
EventID.l = WaitWindowEvent()
If EventID = #PB_Event_CloseWindow
Quit = 1
EndIf
Until Quit = 1
End
As you can see, spin control looks not so clean as above from MSDN.
Re: More beauty for Spin Gadget
Posted: Sun Sep 08, 2013 7:01 am
by JHPJHP
Removed; post ignored.
Re: More beauty for Spin Gadget
Posted: Sun Sep 08, 2013 8:58 am
by Opcode
Korolev Michael wrote:Default Spin Gadget is awful.

OK, I made UpDown a little wider using SetWindowPos_.
MSDN says
Always make a spin control the "buddy" of the text box. Doing so places the spin control inside the text box.
So, how I can make spin control like this?
I tried to place UpDown control inside Text buddy, by using SetWindowPos_. But I can't align text to left in associated Text control. I began to suspect that I need to create my own SpinControl..
I don't get why the gadget hasn't been updated to support the new look. Its really hard to come by a spin gadget like the one PB uses this day in age. Maybe some future enhancements to the GUI library can improve upon these things.
Re: More beauty for Spin Gadget
Posted: Sun Sep 08, 2013 12:39 pm
by Fred
It's updated for the next version.
Re: More beauty for Spin Gadget
Posted: Sun Sep 08, 2013 12:43 pm
by Korolev Michael
Thanks a lot, Fred.
Re: More beauty for Spin Gadget
Posted: Tue Apr 01, 2014 11:37 pm
by jarod_28
Hi, regarding the Spin Gadget, this change in appearance occurs only in the release versions of PureBasic, in appearance if the beta versions is correct.