f



Frame subclass question

In ClipView I inhibit the user altering the vertical size. To do this 
I subclass the frame and then

  case WM_QUERYTRACKINFO:

    if ( SHORT1FROMMP(mp1) ==  1 || /* widen to the left */
         SHORT1FROMMP(mp1) ==  4 || /* widen to the right */
         SHORT1FROMMP(mp1) == 15 || /* move */
         SHORT1FROMMP(mp1) == 31 )  /* alt-f7 move */
    {
      /* empty */;
    }
    else
    {
      return 0;
    }

    // allow normal processing


A user, bless him, has found that with a normal window click on the 
part of the frame that changes the cursor to resize, the double headed
arrow, then that also gives focus to the frame. But with ClipVew it 
only works on the sides. How can I stop a vertical resize but let the 
focus thing happen? 

TIA

-- 
Regards
Dave Saville
0
Dave
11/22/2009 5:32:51 PM
comp.os.os2.programmer.misc 1326 articles. 0 followers. Post Follow

4 Replies
244 Views

Similar Articles

[PageSpeed] 37

On Sun, 22 Nov 2009 17:32:51 UTC, "Dave Saville" 
<dave@invalid.invalid> wrote:

> In ClipView I inhibit the user altering the vertical size. To do this 
> I subclass the frame and then
> 
>   case WM_QUERYTRACKINFO:
> 
>     if ( SHORT1FROMMP(mp1) ==  1 || /* widen to the left */
>          SHORT1FROMMP(mp1) ==  4 || /* widen to the right */
>          SHORT1FROMMP(mp1) == 15 || /* move */
>          SHORT1FROMMP(mp1) == 31 )  /* alt-f7 move */
>     {
>       /* empty */;
>     }
>     else
>     {
>       return 0;
>     }
> 
>     // allow normal processing
> 
> 
> A user, bless him, has found that with a normal window click on the 
> part of the frame that changes the cursor to resize, the double headed
> arrow, then that also gives focus to the frame. But with ClipVew it 
> only works on the sides. How can I stop a vertical resize but let the 
> focus thing happen? 
> 

Ha Ha, found that I have to modify the TRACKINFO structure pointed to 
by mp2. Setting ptlMaxTrackSize.y to the height of my frame works. But
dragging vertically from the top you get a wire frame that snaps back 
to the correct height. Be nice if that did not happen and dragging 
vertically from the bottom you also get the wire frame but when you 
release the mouse the whole window snaps, with correct size, to where 
the bottom has been dragged. I obviously need to hack a few other 
settings but I cannot find TRACKINFO documented as to what things do 
rather than what they are. :-( 
> 


-- 
Regards
Dave Saville
0
Dave
11/22/2009 6:11:10 PM
On Sun, 22 Nov 2009 18:11:10 UTC, "Dave Saville" <dave@invalid.invalid> wrote:

> Setting ptlMaxTrackSize.y to the height of my frame works. But
> dragging vertically from the top you get a wire frame that snaps
> back to the correct height. 

You may try setting both ptlMaxTrackSize.y and ptlMinTrackSize.y 
to your fixed value and return TRUE (without checking 
SHORT1FROMMP(mp1)).


-- 
Ruediger "Rudi" Ihle [S&T Systemtechnik GmbH, Germany]
http://www.s-t.de
Please remove all characters left of the "R" in my email address

0
Ruediger
11/22/2009 7:00:37 PM
On Sun, 22 Nov 2009 19:00:37 UTC, "Ruediger Ihle" 
<NO_SPAM_R.Ihle@S-t.De> wrote:

> On Sun, 22 Nov 2009 18:11:10 UTC, "Dave Saville" <dave@invalid.invalid> wrote:
> 
> > Setting ptlMaxTrackSize.y to the height of my frame works. But
> > dragging vertically from the top you get a wire frame that snaps
> > back to the correct height. 
> 
> You may try setting both ptlMaxTrackSize.y and ptlMinTrackSize.y 
> to your fixed value and return TRUE (without checking 
> SHORT1FROMMP(mp1)).
> 
> 

Thanks, but no cigar.

Returning TRUE stops *any* resize. Seems you *have* to 
return pinstdata->OldProc(hwnd, msg, mp1, mp2); 

-- 
Regards
Dave Saville
0
Dave
11/22/2009 7:53:59 PM
On Sun, 22 Nov 2009 19:53:59 UTC, "Dave Saville" 
<dave@invalid.invalid> wrote:

> On Sun, 22 Nov 2009 19:00:37 UTC, "Ruediger Ihle" 
> <NO_SPAM_R.Ihle@S-t.De> wrote:
> 
> > On Sun, 22 Nov 2009 18:11:10 UTC, "Dave Saville" <dave@invalid.invalid> wrote:
> > 
> > > Setting ptlMaxTrackSize.y to the height of my frame works. But
> > > dragging vertically from the top you get a wire frame that snaps
> > > back to the correct height. 
> > 
> > You may try setting both ptlMaxTrackSize.y and ptlMinTrackSize.y 
> > to your fixed value and return TRUE (without checking 
> > SHORT1FROMMP(mp1)).
> > 
> > 
> 
> Thanks, but no cigar.
> 
> Returning TRUE stops *any* resize. Seems you *have* to 
> return pinstdata->OldProc(hwnd, msg, mp1, mp2); 
> 

Ha, misunderstood you need to do a pinstdata->OldProc(hwnd, msg, mp1, 
mp2); *before* you mess with values and *then* return TRUE.

Thanks for the pointers.
-- 
Regards
Dave Saville
0
Dave
11/22/2009 8:50:18 PM
Reply: