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 

Figure in application

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



Joined: 21 Jun 2006
Posts: 404
Location: Nürnberg, Germany

PostPosted: Thu Jun 27, 2013 2:16 pm    Post subject: Figure in application Reply with quote

Would like to add a figure in an application as shown below. This user then automatically sees the definition of the variables. Do I have to compile the figure as a resource to make it "part" of the program. Which ClearWin function would be the best to use?



Code:

   WINAPP
   INTEGER i,winio@
   i=winio@('%ca[A beautiful bitmap]&')
   i=winio@('%bm[mybitmap]%2nl%cn%`bt[OK]')
   END
   RESOURCES
     mybitmap BITMAP c:\bitmaps\pic1.bmp


or

Code:

  WINAPP
  INTEGER winio@,i
  i=winio@('%ca[Image bar]%sy[3d]&')
  i=winio@('%bd&',0.0D0,0.0D0,0.5D0,1.0D0)
  i=winio@('%mn[File[Exit]]&','EXIT')
  i=winio@('%3ib[flat]','cut/Cut',4,'CONTINUE',
+ 'copy/Copy',4,'CONTINUE', 'paste/Paste',4,'CONTINUE')
  END

  RESOURCES
  cut BITMAP cut.bmp
  copy BITMAP copy.bmp
  paste BITMAP paste.bmp
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Jun 27, 2013 4:57 pm    Post subject: Reply with quote

Basically you need winio@ with %bm, %im or %gi. Probably the best option is to use %im with a jpeg image. Alternatively, if you get the latest beta download of salflibc.dll you could try %im with a png file. The main advantage is that these files use compressed data and so are much smaller than bmp files.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Thu Jun 27, 2013 5:20 pm    Post subject: Reply with quote

You have many choices. If you use %bm, you can pre-draw the bitmap and use it in the resources as you have done. %bm is good because if you want to, you can make the image clickable, like a fancy button. If you use %ic you again need to pre-draw the bitmap, but it will appear against a background of the window, whatever that is. You need to become very skilled with icon editors, and that is difficult. I would recommend %bm. And yes, you have to compile the image. You can do this is a RESOURCES section if your program uses few resources, but if you use many resources, it is better to put them all in a resource file (of type .rc) and pre-compile it with SRC

My alternative response would be to use a %gr area. In the first instance, I would put a bitmap in using IMPORT_IMAGE@, so it isn't much different to %bm, and still needs the image in the resources section. However, with a %gr you could rescale and redraw the image when the dimensions changed by putting a subroutine call to redraw the image into the callbacks for each dimension. In this case, you don't need a pre-drawn image (although it might be easy to have one for use at startup) and you will need a lot of programming. A %gr area will have the 3D look of the input boxes in your window, but if you want them for a %bm you will have to draw them yourself.

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



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

PostPosted: Thu Jun 27, 2013 5:25 pm    Post subject: Reply with quote

Paul posted while I was writing. With lossy compressed file formats like JPEG you will get noticeable visual artifacts for a line drawing - they are fine for photos etc. PNG and GIF are better than JPEG for line drawings, and more equivalent to %bm. If you have a static image you specify it in your set of WINIO@ calls, if you change the image you do that in your callbacks.

E
Back to top
View user's profile Send private message
jjgermis



Joined: 21 Jun 2006
Posts: 404
Location: Nürnberg, Germany

PostPosted: Fri Jun 28, 2013 7:05 am    Post subject: Reply with quote

Thanks - I will try the mentioned options!

ClearWin is really a fine addon. Until know I have use it for very simple calculations in a more or less "DOS-Box" environment. Here feedback from another application.

Recently we integrated this very simple tool in a larger and more complex design program. In oder to do so we just added an option to parse command line arguments. The cool idea behind this is that:
    We can run the program parsing the input file and variables as a simple text-file (or whatever format is required). No GUI appears and the results are written to a file for further processing.

    Should the user need the "old" tool for standalone calculations, one can invoke the GUI by neglecting any command line arguments.

    And the best of all: The maintanance effort is the same - one program in two solutions.

Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Fri Jun 28, 2013 9:47 am    Post subject: Reply with quote

I agree - Clearwin+ enables 'old dogs' to learn 'new tricks' (according to folk knowledge, they cannot!).

I am enormously envious that you can get a printer icon onto the caption bar. Even though the current Windows User Experience Guide says that you should not do it, it looks great. How do you do it?

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



Joined: 21 Jun 2006
Posts: 404
Location: Nürnberg, Germany

PostPosted: Fri Jun 28, 2013 10:56 am    Post subject: Reply with quote

Hi Eddie

The printer icon is done automatically by a program called Hardcopy. I could not find any information in English. Anyway the website shows some screen shots.
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Fri Jun 28, 2013 4:15 pm    Post subject: Reply with quote

The website comes up in English for me! Thanks.

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 -> 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