Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : GUI Line?
Author | Message | ||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9066 |
Hi. I often want to underline text in a menu on an GUI page. At the moment, I am just using the LINE command to directly draw the line, but with GUI programming, EVERYTHING is supposed to be a declared GUI element - such as using GUI CAPTION for text. Is this likely to cause problems later? Is there any way to correctly deal with underlining captions in a GUI? Could this be added by way of a Cfunction or other? I guess I could use an underline font, but the underline is a different colour to that of the caption text it is under, so that won't really be idea either. Any suggestions or input at this point would be great, as I don't REALLY want to use any standard drawing commands when setting up my GUI pages, as that is considered a no-no, but I still want my underlining.......... Smoke makes things work. When the smoke gets out, it stops! |
||||
disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 844 |
I have not tried it, but will GUI Display Box accept a height of 1 or 2. to give you a line. From the manual: Display Box GUI DISPLAYBOX #ref, StartX, StartY, Width, Height, FColour, BColour This will draw a box with rounded corners. Any text can be displayed in the box by using the CtrlVal(r) = command. This is useful for displaying text, numbers and messages. This control does not respond to touch. Latest F4 Latest H7 |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9066 |
Worth a try - I will look into it. EDIT: Nope. Invalid. Minimum is 16, which is way too big. If anyone else has any ideas here.... At the end of the day, I can - and will - just put the main menu title inside a display box and deal with it that way. There will be no underlining in that case, but I would rather play by the GUI rules then end up with a mixture of GUI and standard drawing commands which might cause problems later. So, this is a low-priority thread in other words..... Smoke makes things work. When the smoke gets out, it stops! |
||||
disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 844 |
What about a 17 high display box in the background colour over the top of the 16 high display box, just leaving the bottom line not overwritten. Latest F4 Latest H7 |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
This is something missing in the MM+. There needs to be some way to draw lines, etc under GUI control so that they are dimmed when a number/text box pops up. On my todo list. Geoff Geoff Graham - http://geoffg.net |
||||
Phil23 Guru Joined: 27/03/2016 Location: AustraliaPosts: 1664 |
Hi Grog, Have you tried mixing Basic & advanced graphics? I know it's not recommended, but I've played with it a bit with good results. Just needed to have a few checks in place, to trap for the conflicts. From memory, CLS & GUI Show All & some basic graphics refreshes. There's some of the code in this post. Cheers Phil. |
||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1804 |
Grogs, Haven't tried this but could you use font tweak to make the underlined characters you need. Paul. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9066 |
Hi there. @ Phil23 - YES, that DOES work, but I am loathe to use it, as generally speaking, it is a no-no to mix GUI elements and standard graphics elements if you want a trouble-free GUI experience. I know that this can and does cause LOTS of issues, as my first experiments did exactly that, and the GUI would get corrupted and all sorts of horrible things went on, so this time around, I have learned from that mistake, and am coding the GUI system in entirely GUI controlled elements - no mix and match. I am happy enough with DISPLAYBOX. It does the job, and a displaybox around the main menu at the top looks better then a simple underline once you look at it more then once or twice. @ Paul - Yeah, I thought of using an underline font at one point too, but now that I have decided to go with the displaybox concept, I'm happy enough. Smoke makes things work. When the smoke gets out, it stops! |
||||
isochronic Guru Joined: 21/01/2012 Location: AustraliaPosts: 689 |
Just a thought, GUI's usually have a convention where the screen elements (active controls) are dimmed if deactivated (not applicable), normal if applicable, and enhanced when they are the focus point. Menus, and menu items, as well..a lot of work to implement but worth it. Underlining doesn't seem to be used much, the early web used it for hypertext instead, so maybe that was the issue |
||||
Print this page |