Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

12046 Posts in 1593 Topics- by 595 Members - Latest Member: KeelmHaxabefe

23. May 2013, 02:18:48 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Vertical Slider/Label
Pages: [1]
Print
Author Topic: Vertical Slider/Label  (Read 245 times)
jeffhoye
developers
Enjoying the stay
***
Offline Offline

Posts: 32


View Profile Email
« on: 21. February 2012, 03:15:40 pm »

As far as I can tell, the Label is only allowed to draw words horizontally.  Similarly, the Slider class can only be used horizontally.  Is there a layout or some other technique that will draw a widget rotated 90 degrees?

Thanks!
-Jeff
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #1 on: 21. February 2012, 09:18:28 pm »

Well, you could extend the Label and override the drawWidget() method. It gets a Texture2DCanvas instance. This is a Graphics2D implementation, which handles affine transforms. The clipping and pixel handling should be able to deal with that just fine.
« Last Edit: 21. February 2012, 09:21:56 pm by Marvin Fröhlich » Logged
jeffhoye
developers
Enjoying the stay
***
Offline Offline

Posts: 32


View Profile Email
« Reply #2 on: 22. February 2012, 08:56:45 pm »

Attempting to make the Label vertical was too complicated for me to figure out, but I managed to get a workaround in my game. 

I added the capability to have a vertical slider.  I believe it works great.  I used the same design as in Scrollbar (with the 2 descriptions).  I added the example to WidgetTest1 in xith-tk.  Make sure to update GTK.xwt to get the new images, and build so it goes to the bin directory.

For the Slider's constructors:
  There's a conflict between reverse compatibility and forward clarity.  I went with the fully reverse compatible approach, perhaps you want to rework it to make it more clear moving forward. 

Thanks!
-Jeff
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic