Graphic Buttons

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
oakej
New User
Posts: 4
Joined: Tue Feb 09, 2016 11:58 am
First Name: John
Last Name: Oakes
Company Name: Swift Transportation
Phone: 901-344-4267
Address 1: 1940 E Brooks Rd.
City: Memphis
State / Province: Tennessee
Zip / Postal Code: 38116
Country: United States
Contact:

Graphic Buttons

Post by oakej »

Firstly I'm very new to Profound. I have a program that uses an indicator called @S1OPT in my subfile which accepts: 1 (View), 2 (Edit) and 4(Delete). I would like to use the graphic buttons of View, edit and delete to handle this so I can remove my cheesy combo box that has an Id of @S1OPT from the conversion. However I don't know how to link or bind those buttons to my @S1OPT inticator.
Colin McNeill
New User
Posts: 15
Joined: Wed Oct 28, 2015 2:48 pm
First Name: Colin
Last Name: McNeill
Company Name: Profound Logic
City: Irvine
State / Province: California
Country: United States
Contact:

Re: Graphic Buttons

Post by Colin McNeill »

Hi John,

You can bind your '@S1OPT' indicator on the graphic buttons using the 'response' property. Please let us know if this answers your questions.

If you have more questions, please send an email to support@profoundlogic.com

Thanks!

Colin
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Graphic Buttons

Post by Scott Klement »

I'm guessing that @S1OPT is not really an 'indicator'? Indicators can only have values of '0' (*OFF) or '1' (*ON). It sounds like you have a variable that's intended to contain an option, 1=View, 2=Edit, 4=Delete.

A button, however, only has two possibilities... either it has been clicked or it hasn't. So an indicator is the natural response to a button... But the @S1OPT field doesn't seem like the right sort of field to he used as the response to a button because it isn't really an indicator.

What you could do, if you still want to use this @S1OPT field is assign actual indicators to each button, for example make indicators named btnView, btnEdit and btnDelete and bind these variables to the 'response' property of the three buttons. Then, in the RPG program you would do this:

Code: Select all

select;
when btnView = *on;
   @S1OPT = '1';
when btnEdit = *on;
  @S1OPT = '2';
when btnDelete = *on;
  @S1OPT = '4';
other;
  @S1OPT = ' ';
endsl;
Though, of course, depending on how your code was written, it may be better/nicer to just change the rest of the program to look fo the btnView, btnEdit and btnDelete values directly and remove the @S1OPT field completely.

Also, because this is in a subfile, you'll need to turn the values off again and update the subfile so the buttons are not "stuck on". Youl'd do that with some code like this:

Code: Select all

btnView = *off;
btnEdit = *off;
btnDelete = *off;
update MYSFLREC;
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests