[Implemented] More beauty for Spin Gadget

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Korolev Michael
Enthusiast
Enthusiast
Posts: 200
Joined: Wed Feb 01, 2012 5:30 pm
Location: Russian Federation

[Implemented] More beauty for Spin Gadget

Post by Korolev Michael »

Default Spin Gadget is awful. Image 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? Image

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..
Former user of pirated PB.
Now registered user :].
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Re: More beauty for Spin Gadget

Post 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?
Korolev Michael
Enthusiast
Enthusiast
Posts: 200
Joined: Wed Feb 01, 2012 5:30 pm
Location: Russian Federation

Re: More beauty for Spin Gadget

Post 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.
Former user of pirated PB.
Now registered user :].
User avatar
JHPJHP
Addict
Addict
Posts: 2252
Joined: Sat Oct 09, 2010 3:47 am

Re: More beauty for Spin Gadget

Post by JHPJHP »

Removed; post ignored.
Last edited by JHPJHP on Sat May 26, 2018 8:55 pm, edited 3 times in total.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Opcode
Enthusiast
Enthusiast
Posts: 138
Joined: Thu Jul 18, 2013 4:58 am

Re: More beauty for Spin Gadget

Post by Opcode »

Korolev Michael wrote:Default Spin Gadget is awful. Image 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? Image

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.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: More beauty for Spin Gadget

Post by Fred »

It's updated for the next version.
Korolev Michael
Enthusiast
Enthusiast
Posts: 200
Joined: Wed Feb 01, 2012 5:30 pm
Location: Russian Federation

Re: More beauty for Spin Gadget

Post by Korolev Michael »

Thanks a lot, Fred.
Former user of pirated PB.
Now registered user :].
jarod_28
New User
New User
Posts: 1
Joined: Tue Apr 01, 2014 10:51 pm

Re: More beauty for Spin Gadget

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