forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dynamically created icons and %lv

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 719
Location: Morrison, CO, USA

PostPosted: Sat Feb 22, 2020 4:23 pm    Post subject: Dynamically created icons and %lv Reply with quote

Is it possible to define a set of icons at run-time, then associate those icons with a %lv that uses icon view? I have a user who is visually impaired (color vision) who wishes to have the colors he can readily see presented, rather than the "standard" colors.

I have built and used icons at run-time, so that is not the issue.

The issue is the syntax that would be required to supply handles to %lv versus the name of a pre-defined icon.

If this is at all possible.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6224
Location: Salford, UK

PostPosted: Sat Feb 22, 2020 4:38 pm    Post subject: Reply with quote

It is not immediately clear to me how to do that. Do doubt it can be done by providing extra functionality in ClearWin+. I will make a note to look into the matter.
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 719
Location: Morrison, CO, USA

PostPosted: Sat Feb 22, 2020 5:44 pm    Post subject: Reply with quote

Before I posted this, I looked at the MSDN definition of this feature, and the only example they gave was using the names of the icons. I'm not too hopeful.

The only other way I can see to handle this is to create multiple "versions" of the icon in different colors to handle the accessibility issue. Manually, that could be exhausting. That's my fallback position; create a set of icons that he can more easily see and allow one of two sets to be selected, by name.
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2074
Location: Yateley, Hants, UK

PostPosted: Sat Feb 22, 2020 9:33 pm    Post subject: Reply with quote

Bill,

If it’s any help, I have an application that offers different toolbar designs: with the three different %ib styles and two different %tb styles. The ‘Options’ menu has an ‘Appearance’ sub menu, which if selected, shows a dialog box with exemplar simplified example toolbars selected by means of a radio button and ‘Select’ or ‘Cancel’ buttons. Clicking ‘Select’ closes the dialog, then closes the main window, but relaunches the main window with the appropriate set of toolbar style and icons.

I’ve got every icon named like ‘New_option1’ etc, so in the WINIO@ call the icons are called up as ‘New_’//extension where the variable extension is ‘option1’, ‘option2’ etc. The choice is saved in an INI file so that when the program is restarted, the previously selected appearance is loaded by default.

I've still had to draw all the icons, though, although for Windows 10 style this is a matter of recolouring rather than redrawing.

Eddie
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 719
Location: Morrison, CO, USA

PostPosted: Sat Feb 22, 2020 11:02 pm    Post subject: Reply with quote

Eddie, thanks for the offer. I am currently using "standard" menu drop-downs, and having a tool bar and icons might be better. I'll keep it in mind!

This problem is different, though. I need to label the rows of a list view. The list view can contain thousands of lines, most of which (hopefully) don't require a marker to indicate a problem. That's how I'm using it - to mark issues or status.

The icon, as displayed, can reasonably indicate 4 status "bits", 4 conditions shown as pie shapes on the horizontal and vertical edges. Or, by using patterns with color, the whole icon area can convey a meaning. But, there is a point of diminishing returns as the smaller the color patch, the harder it is to discern what color it might be next to a color of similar brightness. Trying to stay away from RED as many males are color blind to this or colors which contain red. And, for me, light blue and green, when displayed next to each other and small, tend to merge together.

Bill
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2074
Location: Yateley, Hants, UK

PostPosted: Mon Feb 24, 2020 10:46 am    Post subject: Reply with quote

Hi Bill,

Just a note to say that even if you have a toolbar, you need the options available via the menu system - or at least, I do - and also via accelerator keys.

In another app I have used the LED symbol (%ld) to denote status for an item. You might try that, although the actual LED symbols were probably designed for VGA resolution! (Hence they are a little crude). In my case this doesn't matter as there are comparatively few on display at a time (2 columns of 15). They work because listview is one of the things I can't get to work the way I want, and programming what I want has given me more freedom.

Eddie
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 719
Location: Morrison, CO, USA

PostPosted: Tue Feb 25, 2020 4:24 am    Post subject: Reply with quote

Eddie, this is a great option for some of the dialog/windows! Can't believe I never ran across it before. Unfortunately, can't be used in a %lv.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6224
Location: Salford, UK

PostPosted: Tue Feb 25, 2020 12:57 pm    Post subject: Reply with quote

The image list for %`lv can take the form of a string "red,green,blue" where red, green and blue are the names of icons in a resource script...

red ICON red.ico
green ICON green.ico
blue ICON blue.ico

But the list can also be written in terms of the file names as "{red.ico},{green.ico},{blue.ico}".

Another option is to put an integer value in curly brackets where this value is the HANDLE of the icon loaded directly using the file name but there does not appear to be a function immediately available to do this.

The file list with curly brackets could be formed in a large Fortran character variable. Perhaps it could be done with a DO loop but I would need further details (and maybe brush up my Fortran) to make progress.
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 719
Location: Morrison, CO, USA

PostPosted: Tue Feb 25, 2020 5:20 pm    Post subject: Reply with quote

Paul, actually this is exactly the way I would intend to have dynamically changing icons (fixed when the %lv is created). Having the icon name was my only other option (similar to the file name). I was trying to allow the user to create the icons dynamically at run-time, so the handle list can work great. I'll have no trouble meeting the syntax requirements. I'll give these a try and see if I can find any holes/issues.

Thanks so much!

Bill
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 719
Location: Morrison, CO, USA

PostPosted: Tue Feb 25, 2020 7:15 pm    Post subject: Reply with quote

Awesome, Paul! This works really well (the handle to a run-time icon), and I can certainly use it to my advantage. Also, one can "mix" the forms in the same string, using a file name or a handle along with a name.

Again, thanks for getting this out there!

Bill
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 1283
Location: Aerospace Valley

PostPosted: Thu Feb 27, 2020 12:33 am    Post subject: Reply with quote

Paul wrote:
Quote:
Another option is to put an integer value in curly brackets where this value is the HANDLE of the icon loaded directly using the file name but there does not appear to be a function immediately available to do this.


I assume 'to do this' means to get the handles of the icons ?

So how did you get the handles Bill ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 719
Location: Morrison, CO, USA

PostPosted: Thu Feb 27, 2020 12:56 am    Post subject: Reply with quote

The example in the HELP file (%ic text) wasn't helpful, but I didn't try all that hard. I'm not sure, other than the standard icons, how to fully use this. The MSDN documentation is confusing to me.

However, you can MAKE_ICON@() which return the handle, then put that handle into the string (trim(cnum()) works fine). If you already know the icon name (from the resource file) or the file name, then the extra step to create a handle doesn't seem worth it for my application. If I decide to have only a single color and not an image in the icon, then this will be my solution. Also, makes it really easy for the user to tell me what color they would like it to be (config information), and I make it for them each time the program runs.

I wish there was a GET_ICON@() that returned a 32x32 character array so I could change the color in those cases where there is a deficit for the user, rather than coming up with a variety of icons that are different only in color. I think that is asking too much, since the MAKE_ICON@() only has 16 colors it can make.
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 1283
Location: Aerospace Valley

PostPosted: Thu Feb 27, 2020 10:26 pm    Post subject: Reply with quote

thanks for the explanation Bill
Can't you just 'dynamically' re- MAKE_ICON@ according to a user's interacive input for their colour of choice ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 719
Location: Morrison, CO, USA

PostPosted: Fri Feb 28, 2020 9:15 pm    Post subject: Reply with quote

Yes, that's what is being said in the second paragraph.

Quote:
Also, makes it really easy for the user to tell me what color they would like it to be (config information), and I make it for them each time the program runs.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group