Re: Dragging and Wimp_OpenWindow
- From: Erik Groenhuis <erikgspm@xxxxxxxxxxxx>
- Date: Fri, 20 Jan 2006 18:31:50 +0100
As Jan-Jaap van der Geer <jjvdgeer@xxxxxxxx> wrote:
> Hoi Erik,
>
> Erik Groenhuis <erikgspm@xxxxxxxxxxxx> wrote:
> > In short: the window shows a table of strings, in rows and
> > columns. At the top of the window there is a line of headers that
> > look like buttons.
>
> I have done something similar with the columns in DirSync.
I think I have a copy lying around somewhere... Yes, found it.
Indeed, that is the sort of behaviour I was looking for.
[snip: header labels handling]
> In DirSync, the labels are a separate window.
Is this a toolbar window (in Template terms: a pane window?)
> Whenever the pointer
> moves inside this window, I start using the null events to check if
> I should change the pointer type, based on the boundaries of the
> icons. Not sure if this has advantages, but that is the way I do
> it...
This approach works. In essence you do a similar thing to what the Wimp
does when you set a P command in an icon's validations string. Your
method gives better control.
It is possible I will revert to that method too. When a border is
dragged, many header buttons need to move and one needs to change size.
This movement may confuse the Wimp and the pointer may lose it's shape.
It is also rather hard to move buttons (icons). Maybe it's easier with
Toolbox gadgets.
Currently I'm thinking of using Wimp_PlotIcon to paint the icons
directly. New problem: where will I get my click/drag events from?
Maybe use one very wide invisible button for that.
Note by the way that a great difficulty with the header buttons is that
on a vertical scroll they should stay at the top of the window, not
moving along with the scroll. This suggests a toolbar/pane window. On a
horizontal scroll, the headers should scroll along with the main body
of the window. This suggests *not* using a toolbar/pane.
It is likely that vertical scrolls will be more commonly used than
horizontal ones. So a toolbar/pane might be the way to go, accepting
the problems or worse performance for horizontal scrolls.
How do you move/resize the header label icons?
[snip]
> > - The program calls Wimp_DragBox (PRM 3-145) with drag type 7
> > (Point drag).
>
> I use 6 myself.
I thought of type 7 because it doesn't show a drag box. Ah, I see.
DirSync shows a drag box around the entire column. This might become a
nice optional feature.
[snip: handling the drag]
> > Here my understanding of how the Wimp behaves ends. Does the call
> > to Wimp_OpenWindow cause any part of the window to be redrawn? If
> > so, will the scheme outlined above cause parts of the window to
> > be redrawn twice? Can that be prevented?
>
> I seem to be running SetExtent, followed by OpenWindow, and finally
> I do a ForceRedraw for all columns to the right of the resized
> column + the resized column itself. That seems to work OK.
Am I right in thinking that you don't use an UpdateWindow/GetRectangle
cycle? The ForceRedraw will of course cause a regular redraw of the
bits concerned.
[snip: using Wimp_BlockCopy]
> I have not done that but I do not think I have thought about it
> either. It seems to me that using BlockCopy might not look so good
> with certain background-tiles.
Yes, the PRM warns about this. It might still be a good solution to
speed up the dragging (DirSync has a noticable top-to bottom redraw of
the columns during the drag). The problem will show during the drag. At
the end of the drag, we can Force_Redraw once, and thus straighten out
the background.
> PS: You seem to have forgotten a feature in your description: The
> possibility to move columns around by dragging them...
Oooh! Fany feature. Wouldn't have thought of it in a million years. And
whadda-ya-know: Messenger does it too! Never knew that.
--
Erik Groenhuis http://www.xs4all.nl/~erikgrnh
== 'From:' address is a spam trap. Do not use
== See web site for email address
.
- Follow-Ups:
- Re: Dragging and Wimp_OpenWindow
- From: Jan-Jaap van der Geer
- Re: Dragging and Wimp_OpenWindow
- From: Martin Wuerthner
- Re: Dragging and Wimp_OpenWindow
- References:
- Dragging and Wimp_OpenWindow
- From: Erik Groenhuis
- Re: Dragging and Wimp_OpenWindow
- From: Jan-Jaap van der Geer
- Dragging and Wimp_OpenWindow
- Prev by Date: Re: Dragging and Wimp_OpenWindow
- Next by Date: Re: Dragging and Wimp_OpenWindow
- Previous by thread: Re: Dragging and Wimp_OpenWindow
- Next by thread: Re: Dragging and Wimp_OpenWindow
- Index(es):