View previous topic :: View next topic |
Author |
Message |
Felin
Joined: 29 Jul 2009 Posts: 7 Location: Erlangen, Germany
|
Posted: Wed Jul 29, 2009 1:34 pm Post subject: Graphic area (%gr) and "window" inside |
|
|
Is it possible to have another "window" inside a graphic area created by "%gr", at the bottom right part of the graphic area? In this window (or can it perhaps also be a graphic area?) should some text be displayed and it should contain a scrollbar in case there's too many text which should be displayed. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Jul 30, 2009 8:42 am Post subject: |
|
|
You can do most things like this but it does not come naturally using ClearWin+. You would need to create the right kind of control somewhere else and then move it on top of the %gr region.
I could give you general hints on what to do but the details of the task are beyond the design of ClearWin+ and beyond my normal input into the forum.
As I have mentioned elsewhere, I would probably have to end up coding this for you. |
|
Back to top |
|
|
Felin
Joined: 29 Jul 2009 Posts: 7 Location: Erlangen, Germany
|
Posted: Thu Jul 30, 2009 9:06 am Post subject: |
|
|
OK, thank you anyway, but I think I have to try myself. I'm not supposed to send the whole code, especially as there are some parts which shouldn't go out of the company.
I will just try my very best and if I don't manage, then I don't. And if I say that there's no easy way, then my tutors will accept. |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Thu Jul 30, 2009 1:14 pm Post subject: |
|
|
If you only need graphics areas and not menu controls, you can manage your own "window" areas in a single %gr window, by just drawing them. I use a porthole feature, where I only update a small part of the screen as I move the mouse over the main screen.
There is also the ability to have tabs, and I think some of them can be %gr. I have seen this mentioned in the forum, bit I havn't used this feature. Someone else may have an idea.
Good luck
John |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Jul 31, 2009 7:49 pm Post subject: |
|
|
The simple answer is that there isn't a simple answer! But in principle, what you are asking for can be done using the subroutines CREATE_GRAPHICS_REGION@ and COPY_GRAPHICS_REGION@. There's nothing to stop you simply drawing in an area of the background %gr, but then you'll need to manage any "crop to fit".
I suggest creating two graphics regions of the size and shape you want to put on top. Save the contents of the underlying %gr graphics region to one of them. Draw what you want to appear in that space in the other, and simply copy it across when it is ready. Restoring the original window contents is a question of replacing the saved contents in the right place.
You may need to contemplate what needs to be done if the window is resized (probably best to make it not resizable!) and how to find mouse coordinates in the insert (not difficult) if you want to interact with it.
If what you want to appear in your insert is "pre-drawn", then you can use one of the IMPORT_IMAGE@, IMPORT_PCX@ or IMPORT_BMP@ routines to import a resource.
Possibly, if you really do want a scrollable block of text, then you should contemplate using a %cw control UNDERNEATH your %gr region. There's nothing to stop you simply closing a window that has only a %gr and drawing one in its place that has a %gr AND a %cw - and reverting to a window that has just a %gr at some later time.
Eddie |
|
Back to top |
|
|
|