Ignore:
Timestamp:
Dec 9, 2000, 8:19:42 PM (25 years ago)
Author:
umoeller
Message:

Major updates; timers, LVM, miscellaneous.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/comctl.c

    r8 r14  
    5353/*
    5454 *      Copyright (C) 1997-2000 Ulrich M”ller.
    55  *      This file is part of the XWorkplace source package.
    56  *      XWorkplace is free software; you can redistribute it and/or modify
     55 *      This file is part of the "XWorkplace helpers" source package.
     56 *      This is free software; you can redistribute it and/or modify
    5757 *      it under the terms of the GNU General Public License as published
    5858 *      by the Free Software Foundation, in version 2 as it comes in the
     
    117117
    118118/* ******************************************************************
    119  *                                                                  *
    120  *   Global variables                                               *
    121  *                                                                  *
     119 *
     120 *   Global variables
     121 *
    122122 ********************************************************************/
    123123
     
    127127
    128128/* ******************************************************************
    129  *                                                                  *
    130  *   "Menu button" control                                          *
    131  *                                                                  *
     129 *
     130 *   "Menu button" control
     131 *
    132132 ********************************************************************/
    133133
     
    149149    HWND        hwndMenu;
    150150} MENUBUTTONDATA, *PMENUBUTTONDATA;
     151
     152/*
     153 *@@ ctlDisplayButtonMenu:
     154 *      displays the specified menu above the button.
     155 *
     156 *@@added V0.9.7 (2000-11-29) [umoeller]
     157 */
     158
     159VOID ctlDisplayButtonMenu(HWND hwndButton,
     160                          HWND hwndMenu)
     161{
     162    SWP     swpButton;
     163    POINTL  ptlMenu;
     164    WinQueryWindowPos(hwndButton, &swpButton);
     165    ptlMenu.x = swpButton.x;
     166    ptlMenu.y = swpButton.y;
     167
     168    // ptlMenu now has button coordinates
     169    // relative to the button's parent;
     170    // convert this to screen coordinates:
     171    WinMapWindowPoints(WinQueryWindow(hwndButton, QW_PARENT),
     172                       HWND_DESKTOP,
     173                       &ptlMenu,
     174                       1);
     175
     176    // now show the menu on top of the button
     177    WinPopupMenu(HWND_DESKTOP,               // menu parent
     178                 hwndButton,                 // owner
     179                 hwndMenu,
     180                 (SHORT)(ptlMenu.x),
     181                 (SHORT)(ptlMenu.y + swpButton.cy - 1),
     182                 0,                          // ID
     183                 PU_NONE
     184                     | PU_MOUSEBUTTON1
     185                     | PU_KEYBOARD
     186                     | PU_HCONSTRAIN
     187                     | PU_VCONSTRAIN);
     188}
    151189
    152190/*
     
    288326                        // menu successfully loaded:
    289327                        // find out where to put it
    290                         SWP     swpButton;
    291                         POINTL  ptlMenu;
    292                         WinQueryWindowPos(hwndButton, &swpButton);
    293                         ptlMenu.x = swpButton.x;
    294                         ptlMenu.y = swpButton.y;
    295 
    296                         // ptlMenu now has button coordinates
    297                         // relative to the button's parent;
    298                         // convert this to screen coordinates:
    299                         WinMapWindowPoints(WinQueryWindow(hwndButton, QW_PARENT),
    300                                            HWND_DESKTOP,
    301                                            &ptlMenu,
    302                                            1);
    303 
    304                         // now show the menu on top of the button
    305                         WinPopupMenu(HWND_DESKTOP,               // menu parent
    306                                      hwndButton,                 // owner
    307                                      pmbd->hwndMenu,
    308                                      (SHORT)(ptlMenu.x),
    309                                      (SHORT)(ptlMenu.y + swpButton.cy - 1),
    310                                      0,                          // ID
    311                                       PU_NONE
    312                                          | PU_MOUSEBUTTON1
    313                                          | PU_KEYBOARD
    314                                          | PU_HCONSTRAIN
    315                                          | PU_VCONSTRAIN);
     328                        ctlDisplayButtonMenu(hwndButton,
     329                                             pmbd->hwndMenu);
    316330                    } // end if (pmbd->hwndMenu)
    317331                    else
     
    484498
    485499/* ******************************************************************
    486  *                                                                  *
    487  *   Subclassed Static Bitmap Control                               *
    488  *                                                                  *
     500 *
     501 *   Subclassed Static Bitmap Control
     502 *
    489503 ********************************************************************/
    490504
     
    788802
    789803/* ******************************************************************
    790  *                                                                  *
    791  *   Icon animation                                                 *
    792  *                                                                  *
     804 *
     805 *   Icon animation
     806 *
    793807 ********************************************************************/
    794808
     
    967981
    968982/* ******************************************************************
    969  *                                                                  *
    970  *   Bitmap functions                                               *
    971  *                                                                  *
     983 *
     984 *   Bitmap functions
     985 *
    972986 ********************************************************************/
    973987
     
    10501064
    10511065/* ******************************************************************
    1052  *                                                                  *
    1053  *   Hotkey entry field                                             *
    1054  *                                                                  *
     1066 *
     1067 *   Hotkey entry field
     1068 *
    10551069 ********************************************************************/
    10561070
Note: See TracChangeset for help on using the changeset viewer.