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 

Things to to do with %bm

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



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

PostPosted: Sun Aug 25, 2019 5:26 pm    Post subject: Things to to do with %bm Reply with quote

I'm using a bit-map to indicate whether or not a data item is in error. The intent was to not place an image (or change it) if the item is corrected. It would appear that the bit-map using %bm is static and cannot be changed dynamically. I wondered if this is true, or is there a function that can dynamically change a bit-map?

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



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

PostPosted: Sun Aug 25, 2019 8:55 pm    Post subject: Reply with quote

Bill,

If you use a small %gr, you can import images of various types at will - which does what you want.

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Aug 26, 2019 7:43 am    Post subject: Reply with quote

For %rd and %rf, it might be worth looking at item 401 of cwplus.enh. This describes how %rd and %rf can automatically display an error icon for out-of-range values.

Otherwise you could consider creating two images that are made to occupy the same position. Then call SET_CONTROL_VISIBILITY@ to switch between to two by showing one and then hiding the other.

GET_WINDOW_LOCATION@ and MOVE_WINDOW@ might be used to make the images occupy the same position (but I have not tested this).

But Eddie's suggestion might work out to be simpler.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Mon Aug 26, 2019 11:53 am    Post subject: Reply with quote

More to the point, a %gr region can be drawn to, as well as have an image imported using IMPORT_IMAGE@.

I use this with a colour picker where I can set the R, G & B components: the %gr area is re-coloured with a simple rectangle. I also have standard colours for particular strata, e.g. yellow for sand, grey for silt, mid to dark grey for mudstones, etc.*

The IMPORT_IMAGE method is useful when associated with some sort of selector, like a combo box, to show what the selection looks like.

As the IMPORT_IMAGE@ has coordinates, it is possible to have all the individual images on a large bitmap, and when doing the call, just change the coordinates. %gr areas do automatic clipping. This just reduces the large number of images to go into a RESOURCES section.

(A side benefit of having all the images in one big bitmap is that should you decide to change the style of the display - as in going from a Win 7 appearance to Win 10 - you don't have to ferret out all the individual images (if that bothers you).

Eddie

*A thing to remember is that saturated colours look great on screen, but on a printout look garish. Also, with an inkjet, saturated colours make the paper soggy and use up the cartridges at a terrific rate. Infill patterns, (thankfully not provided with CW+) used to be in vogue with monochrome dot matrix printers, even though Edward Tufte refers to them disparagingly as 'chart junk' in his books on graphics.
Back to top
View user's profile Send private message
wahorger



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

PostPosted: Mon Aug 26, 2019 11:53 pm    Post subject: Reply with quote

Eddie, thanks for the suggestion. I did a small experiment, and yes, it can be done! One of the unfortunate side effects of the %gr is the cursor changes to the graphic cursor (as would be expected) when you mouse over this "icon". Still, this may have utility for me in another application, so thanks for encouraging me to experiment!

Paul, the visibility of the control makes a lot of sense for my usage. I'll experiment with that to see if I can integrate it

Bill
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Tue Aug 27, 2019 7:28 am    Post subject: Reply with quote

%cu[CURSOR_ARROW] can be used before %gr in order to change the mouse cursor.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Tue Aug 27, 2019 10:32 am    Post subject: Reply with quote

Bill,

Even better, you can use custom cursors. I particularly like the 'Smooth set' by Vlastimil Milér, and plenty of others can be found on the web. I did a quick search and I can't find the ones I like, so I've zipped them up and put them on Dropbox for you:

https://www.dropbox.com/s/ylxzob4qvgs57ti/SmoothCursors.zip?dl=0

He asks for acknowledgement, otherwise they are free, which I do with a note in the 'About' box.

The little cross has the defect that when it is XORed on a grey background, it disappears.

Using a %gr you can popup some help text as you mouseover the %gr - if you do it in a [volatile] window it disappears when it loses focus.

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



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

PostPosted: Tue Aug 27, 2019 2:35 pm    Post subject: Reply with quote

Paul and Eddie, thanks for again expanding my understanding of what is possible!
Back to top
View user's profile Send private message Visit poster's website
John-Silver



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

PostPosted: Wed Aug 28, 2019 2:21 am    Post subject: Reply with quote

Eddie,

... for posterity, here they are .....
http://www.rw-designer.com/user/vlasta
... always nice to put a face to a name too !
_________________
''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
LitusSaxonicum



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

PostPosted: Wed Aug 28, 2019 10:28 am    Post subject: Reply with quote

Thanks, John.

Incidentally, I have also found a use for the tick and cross from the Fugue set icons by Yusuke Kamiyamane, which I use in a particular application to emphasise the OK and Cancel in buttons defined with %bb (as against the rather taller %bt).

I'll delete the Dropbox link now you have given the source.

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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