Changeset 40

Show
Ignore:
Timestamp:
02/02/08 18:47:27 (10 months ago)
Author:
cinc
Message:

Added function to helpers for pressed key detecting. Some font and color tweaks for the info window

Location:
trunk/helper
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/helper/folderinfownd.c

    r39 r40  
    251251    case WM_PRESPARAMCHANGED: 
    252252      { 
    253         char fontName[255]; 
    254         ULONG  len; 
    255         ULONG  attrFound; 
    256  
    257         len=WinQueryPresParam(hwnd, 
    258                               //len=WinQueryPresParam(WinQueryWindow(hwnd, QW_PARENT), 
    259                               PP_FONTNAMESIZE,0,&attrFound,sizeof(fontName), 
    260                               fontName, 0 /*QPF_NOINHERIT*/); 
    261  
    262  
    263         WinSetPresParam(WinWindowFromID(hwnd, FLDRINFO_WINDOWID_TEXTCTRL),PP_FONTNAMESIZE, 
    264                    len, fontName); 
    265  
     253#if 0 
     254        DosBeep(3000, 20); 
     255        /* Forward presentation parameters to the windows on the top */ 
     256 
     257        switch(LONGFROMMP(mp1)) 
     258          { 
     259          case PP_BACKGROUNDCOLOR: 
     260            SysWriteToTrapLog("PP_BACKGROUNDCOLOR\n"); 
     261            break; 
     262          case PP_FONTNAMESIZE: 
     263            SysWriteToTrapLog("PP_FONTNAMESIZE\n"); 
     264          default: 
     265            break; 
     266          }; 
     267        SysWriteToTrapLog("\n"); 
     268#endif 
     269 
     270        if(PP_FONTNAMESIZE==LONGFROMMP(mp1)) 
     271          { 
     272            char fontName[255]; 
     273            ULONG  len; 
     274            ULONG  attrFound; 
     275 
     276            len=WinQueryPresParam(hwnd, 
     277                                  //len=WinQueryPresParam(WinQueryWindow(hwnd, QW_PARENT), 
     278                                  PP_FONTNAMESIZE,0,&attrFound,sizeof(fontName), 
     279                                  fontName, 0 /*QPF_NOINHERIT*/); 
     280             
     281            WinSetPresParam(WinWindowFromID(hwnd, FLDRINFO_WINDOWID_TEXTCTRL),PP_FONTNAMESIZE, 
     282                            len, fontName); 
     283          } 
    266284        break; 
    267285      } 
  • trunk/helper/ft2lib-htmlwnd.c

    r39 r40  
    16161616          /* Set it */ 
    16171617          WinFillRect(hps, &rcl, (LONG) lBg); 
    1618           //     WinFillRect(hps, &rcl, 0x00FFFFFF); 
    16191618        } 
    16201619#else 
     
    16381637    case WM_PRESPARAMCHANGED: 
    16391638      { 
     1639        MRESULT mr; 
     1640 
     1641        if(g_oldStatic) 
     1642          mr=g_oldStatic( hwnd, msg, mp1, mp2); 
     1643        else 
     1644          mr=WinDefWindowProc( hwnd, msg, mp1, mp2); 
     1645 
     1646#if 0 
     1647        DosBeep(3000, 20); 
     1648        /* Forward presentation parameters to the windows on the top */ 
     1649        SysWriteToTrapLog("%s:\n", __FUNCTION__); 
     1650 
     1651        switch(LONGFROMMP(mp1)) 
     1652          { 
     1653          case PP_BACKGROUNDCOLOR: 
     1654            SysWriteToTrapLog("PP_BACKGROUNDCOLOR\n"); 
     1655            break; 
     1656          case PP_FONTNAMESIZE: 
     1657            SysWriteToTrapLog("PP_FONTNAMESIZE\n"); 
     1658          case PP_FOREGROUNDCOLOR: 
     1659            SysWriteToTrapLog("%s: PP_FOREGROUNDCOLOR\n", __FUNCTION__); 
     1660          default: 
     1661            break; 
     1662          }; 
     1663        SysWriteToTrapLog("\n"); 
     1664#endif 
    16401665        switch(LONGFROMMP(mp1)) 
    16411666          { 
     
    16641689                                   PP_FOREGROUNDCOLOR,0,&attrFound,sizeof(fg), 
    16651690                                   &fg, QPF_NOINHERIT)) 
    1666  
     1691                 
    16671692                wndData->lForeColor=(LONG)fg; 
    1668             break; 
     1693              break; 
    16691694            } 
    1670  
    16711695          case PP_FONTNAMESIZE: 
    16721696            { 
     
    16821706 
    16831707                WinInvalidateRect(hwnd, NULLHANDLE, TRUE); 
     1708                break; 
    16841709              } 
    16851710            } 
     
    16871712            break; 
    16881713          } 
    1689         break; 
     1714        return mr; 
     1715        // break; 
    16901716      } 
    16911717      /* Vertical slider */ 
     
    19111937 
    19121938          // Set the font 
     1939          /* If the font isn't set properly the code will more or less randomly grab some font. Note 
     1940             that by setting the font here the set font of a folder container is *not* used. */ 
    19131941          WinSetPresParam(hwnd, 
    19141942                          PP_FONTNAMESIZE,(ULONG) strlen(fontName)+1, /* +1 because of terminating 0 */ 
  • trunk/helper/helper_gcc.c

    r16 r40  
    1818 */ 
    1919#define INCL_DOS 
     20#define INCL_DOSDEVIOCTL 
    2021#define INCL_DOSERRORS 
    2122#define INCL_WIN 
     
    115116    WinSetObjectData(hObject, command); 
    116117  } 
     118} 
     119 
     120static USHORT queryShiftState(void) 
     121{ 
     122    USHORT     usRc=0; 
     123    HFILE      hf; 
     124    ULONG      ulAction; 
     125 
     126    if (NO_ERROR==DosOpen("KBD$", &hf, &ulAction, 0, FILE_NORMAL, 
     127                          OPEN_ACTION_OPEN_IF_EXISTS, /* fsOpenFlags */ 
     128                          OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE, 
     129                          NULLHANDLE)) 
     130      { 
     131        SHIFTSTATE      ss; 
     132        ULONG           cbDataLen = sizeof(ss); 
     133         
     134        if (NO_ERROR == DosDevIOCtl(hf, IOCTL_KEYBOARD, KBD_GETSHIFTSTATE, 
     135                                    NULL, 0, NULL, &ss, cbDataLen, &cbDataLen)) 
     136          { 
     137            usRc=ss.fsState; 
     138          }/* DosDevIOCtl() */ 
     139        DosClose(hf); 
     140      }/* DosOpen() */ 
     141 
     142    return usRc; 
     143} 
     144 
     145/* 
     146  This function returns true if the Alt and the Ctrl keys are currently pressed. 
     147 */ 
     148BOOL SysQueryAltCtrlPressed(void) 
     149{ 
     150  /* Either Alt and Ctrl key */ 
     151  return ((queryShiftState() & 12)!=0); 
    117152} 
    118153 
     
    172207 
    173208 
    174  
    175  
    176  
    177