Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > GUI Development
  New Posts New Posts RSS Feed - highlighting
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum Lockedhighlighting

 Post Reply Post Reply
Author
Message
rmichaelfrank View Drop Down
Groupie
Groupie


Joined: March 20 2008
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmichaelfrank Quote  Post ReplyReply Direct Link To This Post Topic: highlighting
    Posted: January 06 2010 at 7:01am
I need to allow a user to right click on data they have entered, have a menu popup and allow them to change the color of their highlighted data and save it. I see how to allow them to right click and allow them to change the color.

But I do not know how to find out what test they have highlighted. Any ideas out there?

Michael
Back to Top
rmichaelfrank View Drop Down
Groupie
Groupie


Joined: March 20 2008
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmichaelfrank Quote  Post ReplyReply Direct Link To This Post Posted: January 07 2010 at 12:44am
I have read the programmers guide and cannot find anything relating to how to get highlighted data fromn the user. Is there anyone that knows anything about that?

Michael
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: January 07 2010 at 3:15am
Hi Michael -

You cannot access the highlighted text directly, but you can get the start and length of the highlight. Use the GPSELSTART and GPSELLENGTH properties of the Edit control, then just take a substring of the text.

Thanks,

Pete
Back to Top
rmichaelfrank View Drop Down
Groupie
Groupie


Joined: March 20 2008
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmichaelfrank Quote  Post ReplyReply Direct Link To This Post Posted: January 07 2010 at 3:28am
Pete,
I tried that but GPSELLENGTH & GPSELSTART always show the same values not= matter what is selected:
   CALL ATGUIGETVALUES("DAILY.BILLREC","MAIN","txtBrenda",VAL,GUIERRORS,GUISTATE);*GET ACCTG NOTE
   print GPSELLENGTH
   PRINT GPSELSTART


Michael
Back to Top
rmichaelfrank View Drop Down
Groupie
Groupie


Joined: March 20 2008
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmichaelfrank Quote  Post ReplyReply Direct Link To This Post Posted: January 07 2010 at 3:34am
Ok, I used ATGUIGETPROP and it works - thanks Pete!!


Michael
Back to Top
rmichaelfrank View Drop Down
Groupie
Groupie


Joined: March 20 2008
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmichaelfrank Quote  Post ReplyReply Direct Link To This Post Posted: January 07 2010 at 6:48am
Pete,
Ok, one thing I forgot and am having touble getting it to work. How do I now put the text back on the screen with some of it highlighted in color. (i.e. the test the user highlighted.) That will make it permanent - so it can be stored.

Michael
Back to Top
rmichaelfrank View Drop Down
Groupie
Groupie


Joined: March 20 2008
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmichaelfrank Quote  Post ReplyReply Direct Link To This Post Posted: January 07 2010 at 7:14am
Pete,
I now see that I can highlight text using GPFORECOLOR but still cannot get just the user selected text to highlight...

Michael
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: January 07 2010 at 8:42am
Hi Michael -

The highlight color used for selections is not a property you can set - its a global Windows setting. To set the highlight is just the opposite of getting the highlight - just set the GPSELSTART and GPSELLENGTH properties after setting the GPVALUE property with the full text.

Thanks,

Pete
Back to Top
rmichaelfrank View Drop Down
Groupie
Groupie


Joined: March 20 2008
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmichaelfrank Quote  Post ReplyReply Direct Link To This Post Posted: January 07 2010 at 11:41pm
Thanks for the info Pete! That works however, the highlighting goes away if I click on anything else and I cannot set the color of the highlight. I need to save the highlighted info for reading later. I am
1) loading values
2) setting GPSELSTART
3) setting GPSELELNGTH


Your help is GREATLY Appreciated!
Michael
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: January 08 2010 at 2:23am
Hi Michael -

You cannot set the color of the highlight, except by setting the display properties in Windows itself. The highlight is used to denote a selection in the text box, and not generally useful for simply highlighting a word or phrase. Clicking in a text box removes the selection - just like any other Windows text box. You might be able to disable the text box so that it does not respond to clicks - I'm not sure if that would clear the selection or not.

Thanks,

Pete
Back to Top
rmichaelfrank View Drop Down
Groupie
Groupie


Joined: March 20 2008
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmichaelfrank Quote  Post ReplyReply Direct Link To This Post Posted: January 11 2010 at 12:22am
Thanks Pete,

Too bad we cannot have a user highlight in color. I will try disabling the text box.

Michael
Back to Top
mlucas67 View Drop Down
Senior Member
Senior Member


Joined: February 12 2007
Location: United States
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote mlucas67 Quote  Post ReplyReply Direct Link To This Post Posted: January 20 2010 at 1:30am

Sounds like what you are really after is what is called an RTF Textbox (Rich Text Format).  In VB it allows you to bold, italicize, change color, etc of portions of text just like a word processor (Word) would do. 

You could write your application in full VB and still use Accuterm as your connection using the .NET wrappers.  Then you would have the full VB toolbox of controls.
 
It would be nice to have a full toolbox, but most of us are just trying to move from green screen into GUI so we didn't have such features to begin with. 
 
Marshall
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: January 20 2010 at 10:26am
Hi Michael -

If the field is display-only, AccuTerm 7 has a new "html viewer" control. You can format the text using html tags and load it into the html control. But it would be for display only, not editing.

Thanks,

Pete

PS: AccuTerm coming soon!
Back to Top
rmichaelfrank View Drop Down
Groupie
Groupie


Joined: March 20 2008
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmichaelfrank Quote  Post ReplyReply Direct Link To This Post Posted: January 20 2010 at 10:52pm
Thanks Pete, yes that is all I need at this time - a viewer. I will be waiting for version 7!
Thanks.
Michael
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.