Topic: New Tools !? Zoom

Viewing 6 posts - 1 through 6 (of 6 total)
  • #215
    planist
    Participant

    i would love to have zoom tools like:

    pressing (eg.) A + moving the mouse = vertical and horizontal zoom IN
    pressing (eg.) S + moving the mouse = vertical and horizontal zoom OUT

    also, pressing Z + mouse like in sonar.

    jeff

    #3485
    Zynewave
    Keymaster

    Hi Jeff,

    There are already some key shortcuts to zoom tools. Press and hold the following keys, and click and drag at the point you want your zoom to be anchored:

    Control+shift to zoom vertically
    Control+alt to zoom horizontally
    Control+shift+alt to zoom both x/y
    Shift+alt to slide zoomed area.

    #3486
    Sardaukar
    Participant

    Yes, the current zoom tool shortcut keys are very good.

    If the every Podium vertical scrollbar supported the middle mouse-wheel, that would be a good improvement 🙂

    #3494
    kingtubby
    Participant

    A list of all the available keyboard short-cuts would be helpful.

    Sardaukar wrote:

    If every Podium vertical scrollbar supported the middle mouse-wheel, that would be a good improvement

    Agreed.

    MartinB

    #3500
    duncanparsons
    Participant

    frits

    don’t know if you have code for mousewheel support, but this is what I used in a delphi grid component to enable mousewheel support:

    Declarations


    const WM_MOUSEWHEEL=$020A;
    {SM_MOUSEWHEELPRESENT}
    SM_MOUSEWHEELPRESENT = 75;
    {SPI_GETWHEELSCROLLLINES}
    SPI_GETWHEELSCROLLLINES = 104;
    {SPI_SETWHEELSCROLLLINES}
    SPI_SETWHEELSCROLLLINES = 105; // For Win95 and WinNT3.51,
    // Mswheel broadcasts the message
    // WM_SETTINGCHANGE (equivalent to
    // WM_WININICHANGE) when the scroll
    // lines has changed. Applications
    // will receive the WM_SETTINGCHANGE
    // message with the wParam set to
    // SPI_SETWHEELSCROLLLINES. When
    // this message is received the
    // application should query Mswheel for
    // the new setting.

    type
    TWMMouseWheel = packed record
    Msg: Cardinal;
    Keys: SmallInt;
    WheelDelta: SmallInt;
    case Integer of
    0: (
    XPos: Smallint;
    YPos: Smallint);
    1: (
    Pos: TSmallPoint;
    Result: Longint);
    end;

    somewhere in the creation of the object


    //WM_MouseWheel..
    fIntelliWheelSupport := Boolean (GetSystemMetrics (sm_MouseWheelPresent));
    SystemParametersInfo (spi_GetWheelScrollLines, 0, @fIntelliScrollLines, 0);
    if (fIntelliScrollLines < 0) or (fIntelliScrollLines > 100) then fIntelliScrollLines := 3;// lines to scroll set in component

    object code to handle mousewheel..


    procedure TColorStringGrid.WMMouseWheel(var message:TWMMouseWheel);
    //From Dave Jewells Code in Delphi Magazine (Issue 32, Apr'98)
    const
    Delta: SmallInt = 0;
    var
    Idx: Integer;
    begin
    Delta := Delta + Message.WheelDelta{HiWord (Message.wParam)};
    //windows.messagebox(handle,PChar(inttostr(Delta)),'lala',MB_OK);
    while Abs(Delta) >= 120 do
    begin
    if Delta < 0 then
    begin
    for Idx := 0 to fIntelliScrollLines - 1 do
    {PostMessage (Handle, wm_VScroll, MakeLong (sb_LineDown, 0), 0);}
    if (TopRow Delta := Delta + 120;
    end
    else
    begin
    for Idx := 0 to fIntelliScrollLines - 1 do
    {PostMessage (Handle, wm_VScroll, MakeLong (sb_LineUp, 0), 0);}
    if (TopRow>FixedRows) then TopRow:=TopRow-1;
    Delta := Delta - 120;
    end;
    end;
    end;

    procedure TColorStringGrid.IntelliMouseInit;
    var
    hWndMouse: hWnd;
    mQueryScrollLines: UINT;

    function NativeMouseWheelSupport: Boolean;
    var
    ver: TOSVersionInfo;
    begin
    Result := False;
    ver.dwOSVersionInfoSize := sizeof (ver);
    // For Windows 98, assume dwMajorVersion = 5 (It's 4 for W95)
    // For NT, we need 4.0 or better.
    if GetVersionEx (ver) then case ver.dwPlatformID of
    ver_Platform_Win32_Windows: Result := ver.dwMajorVersion >= 5;
    ver_Platform_Win32_NT: Result := ver.dwMajorVersion >= 4;
    end;

    { Quick and dirty temporary hack for Windows 98 beta 3 }
    if (Result = False) and (ver.szCSDVersion = ' Beta 3') then Result := True;
    end;

    begin
    if NativeMouseWheelSupport then begin
    fIntelliWheelSupport := Boolean (GetSystemMetrics (sm_MouseWheelPresent));
    SystemParametersInfo (spi_GetWheelScrollLines, 0, @fIntelliScrollLines, 0);
    fIntelliMessage := wm_MouseWheel;
    end else begin
    { Look for hidden mouse window }
    hWndMouse := FindWindow ('MouseZ', 'Magellan MSWHEEL');
    if hWndMouse <> 0 then begin
    { We're in business - get the scroll line info }
    fIntelliWheelSupport := True;
    mQueryScrollLines := RegisterWindowMessage ('MSH_SCROLL_LINES_MSG');
    fIntelliScrollLines := SendMessage (hWndMouse, mQueryScrollLines, 0, 0);
    { Finally, get the custom mouse message as well }
    fIntelliMessage := RegisterWindowMessage ('MSWHEEL_ROLLMSG');
    end;
    end;

    if (fIntelliScrollLines < 0) or (fIntelliScrollLines > 100) then fIntelliScrollLines := 3;
    end;

    procedure TColorStringGrid.WndProc (var Message: TMessage);
    function GetShiftState: Integer;
    begin
    Result := 0;
    if GetAsyncKeyState (vk_Shift) < 0 then Result := Result or mk_Shift;
    if GetAsyncKeyState (vk_Control) < 0 then Result := Result or mk_Control;
    if GetAsyncKeyState (vk_LButton) < 0 then Result := Result or mk_LButton;
    if GetAsyncKeyState (vk_RButton) < 0 then Result := Result or mk_RButton;
    if GetAsyncKeyState (vk_MButton) < 0 then Result := Result or mk_MButton;
    end;

    begin
    { If the message is non-native, eat the non-native message and post a native }
    { message. We don't call Inherited, thus ensuring original message is discarded. }
    if (Message.Msg = fIntelliMessage) and (fIntelliMessage <> wm_MouseWheel) then begin
    { We need to convert the non-native info into native format. Bleugh! }
    PostMessage (Handle, wm_MouseWheel, MakeLong (GetShiftState, Message.wParam), Message.lParam);
    end else Inherited;
    end;

    hope that helps, and isn’t too patronising 😳

    If you already had some code, than I hope this helps someone else!!

    DSP

    #3501
    Zynewave
    Keymaster

    Alright, alright 😆 … hint taken.

    I have already started on the mouse wheel support. Shouldn’t be more than a couple of hours work, and one more item on the future list bites the dust.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
© 2021 Zynewave