Normal Topic Fun With Widgets (Read 544 times)
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Fun With Widgets
Feb 5th, 2016 at 1:55am
Print Post Print Post  
Hey folks,

I'm working with widgets for the first time, and I'm running into some basic issues.  Below is my simple window widget to gather multi-line information rather than @PromptForUserInput.

My questions are:

- how can I color the background frame of the input window?
- how can I raise the 'DONE' button, and bold the text?

Thanks!

Code
Select All
#include "sbasic_include.sbas"

var vKey as int
var vWidgetID as int
var vResult as string

vKey = @OpenWindow(100, 50, 500, 500, "TASK DESCRIPTION")

WidgetAttribute(vWidgetID, WIDGET_ATTR_RGB_COLOR, "44, 108, 204")
vWidgetID = @AddWidget(USER_WINDOW_MULTILINE_INPUT, 10, 10, 480, 430, "")
WidgetAttribute(vWidgetID, WIDGET_ATTR_RGB_COLOR, "204, 204, 204")
vWidgetID = @AddWidget(USER_WINDOW_ACCEPT_BUTTON, 430, 460, 50, 20,"DONE")
vResult = @RunWindow()
 

  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Fun With Widgets
Reply #1 - Feb 5th, 2016 at 2:17pm
Print Post Print Post  
Add the widget first, which creates the widget and provides a valid ID, and then affect its attributes.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Fun With Widgets
Reply #2 - Feb 8th, 2016 at 1:17pm
Print Post Print Post  
Well, I tried that and for some reason I can't alter the window frame, just the window panel.

More importantly, my multiline window doesn't have text wrapping.  Is there a WIDGETATTRIBUTE for that?

Thanks!
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Fun With Widgets
Reply #3 - Feb 8th, 2016 at 2:25pm
Print Post Print Post  
BWETTLAUFER wrote on Feb 8th, 2016 at 1:17pm:
Well, I tried that and for some reason I can't alter the window frame, just the window panel.


When you say, "frame" are you referring to the window's border and title bar?

Quote:
More importantly, my multiline window doesn't have text wrapping.  Is there a WIDGETATTRIBUTE for that?

Thanks!


I don't think the base multi-line text widget has a widget attribute for word wrapping. You may have to go with form-as-dialog to get that.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged