Changeset 9076 for trunk/src


Ignore:
Timestamp:
Aug 21, 2002, 5:40:28 PM (23 years ago)
Author:
sandervl
Message:

PF: Fixed OSLibWinSetSysValue; fixed OSLibSetWindowStyle; delete frame controls if required; YD: OSLibWinChangeTaskList & OSLibWinAddToTaskList bugfixes;wrong CharToOemBuffA call

Location:
trunk/src/user32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibwin.cpp

    r9072 r9076  
    1 /* $Id: oslibwin.cpp,v 1.123 2002-08-21 12:32:40 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.124 2002-08-21 15:40:28 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    1616#include <os2wrap.h>
    1717#include <stdlib.h>
     18#include <stdio.h>
    1819#include <string.h>
    1920
     
    280281//******************************************************************************
    281282//******************************************************************************
    282 HWND OSLibWinControlWindow(HWND hwndWindow, INT controlID, HWND controlHWND)
    283 {
    284  HWND hwnd = NULL, hwndParent = NULL;
    285 
    286  if (controlHWND)
    287  {
    288    WinSetParent(controlHWND, hwndWindow, TRUE);
    289    return NULL; // this is done to minimize assignments
    290  }
    291  else
    292  {
    293    hwnd = WinWindowFromID(hwndWindow, controlID);
    294    if (hwnd)
    295    {
    296     WinSetParent(hwnd, HWND_OBJECT, TRUE);
    297     return hwnd;   
    298    }
    299  }
    300  return NULL;
    301 }
    302 //******************************************************************************
    303 //******************************************************************************
    304283HWND OSLibWinWindowFromID(HWND hwndParent,ULONG id)
    305284{
     
    10381017    if(fOS2Look) {
    10391018        ULONG OSFrameStyle = 0;
    1040         if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W) {
     1019        if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W)
     1020        {
    10411021            if(WinWindowFromID(hwndFrame, FID_TITLEBAR) == 0) {
    10421022                OSFrameStyle = FCF_TITLEBAR;
    10431023            }
     1024           
    10441025            if((dwStyle & WS_SYSMENU_W) && !(dwExStyle & WS_EX_TOOLWINDOW_W))
    10451026            {
     
    10481029                }
    10491030            }
     1031
    10501032            if((dwStyle & WS_MINIMIZEBOX_W) || (dwStyle & WS_MAXIMIZEBOX_W)) {
    1051                 if(WinWindowFromID(hwndFrame, FID_MINMAX) == 0) {
    1052                     OSFrameStyle |= FCF_MINMAX;
     1033                if(dwStyle & WS_MINIMIZEBOX_W)
     1034                    if(WinWindowFromID(hwndFrame, FID_MINMAX) == 0) {
     1035                         OSFrameStyle |= FCF_MINBUTTON;
     1036                }
     1037
     1038                if(dwStyle & WS_MAXIMIZEBOX_W)
     1039                    if(WinWindowFromID(hwndFrame, FID_MINMAX) == 0) {
     1040                         OSFrameStyle |= FCF_MAXBUTTON;
    10531041                }
    10541042            }
     
    10591047                }
    10601048            }
    1061         }
    1062         if(OSFrameStyle) {
     1049       }
     1050       // no caption, delete all controls if they exist
     1051       else
     1052       {
     1053          if (WinWindowFromID(hwndFrame, FID_TITLEBAR))
     1054              WinDestroyWindow(WinWindowFromID(hwndFrame, FID_TITLEBAR));
     1055          if (WinWindowFromID(hwndFrame, FID_SYSMENU))
     1056              WinDestroyWindow(WinWindowFromID(hwndFrame, FID_SYSMENU));
     1057          if (WinWindowFromID(hwndFrame, FID_MINMAX))
     1058              WinDestroyWindow(WinWindowFromID(hwndFrame, FID_MINMAX));
     1059       }
     1060       
     1061       if(OSFrameStyle) {
    10631062            FRAMECDATA FCData = {sizeof (FRAMECDATA), 0, 0, 0};
    1064 
     1063            char buffer[255];
    10651064            FCData.flCreateFlags = OSFrameStyle;
    1066             WinCreateFrameControls(hwndFrame, &FCData, NULL);
    1067         }
    1068     }
     1065
     1066            GetWindowTextA(OS2ToWin32Handle(hwndClient), buffer, sizeof(buffer));
     1067            WinCreateFrameControls(hwndFrame, &FCData, buffer );
     1068
     1069            if (WinQueryActiveWindow(HWND_DESKTOP) == hwndFrame)
     1070              WinSendMsg(WinWindowFromID(hwndFrame, FID_TITLEBAR), TBM_SETHILITE, (MPARAM)1, 0);
     1071       }
     1072   } // os2look
    10691073}
    10701074//******************************************************************************
     
    11141118    swctrl.bProgType     = PROG_PM;
    11151119    if(title) {
    1116 //        strncpy(swctrl.szSwtitle, title, MAXNAMEL+4);
    1117         CharToOemBuffA( title, swctrl.szSwtitle, MAXNAMEL+4 );
     1120        CharToOemBuffA( title, swctrl.szSwtitle, min(strlen(title),MAXNAMEL+4) );
    11181121        swctrl.szSwtitle[MAXNAMEL+4-1] = 0;
    11191122    }
     
    11401143    swctrl.bProgType     = PROG_PM;
    11411144    if(title) {
    1142 //        strncpy(swctrl.szSwtitle, title, MAXNAMEL+4);
    1143         CharToOemBuffA( title, swctrl.szSwtitle, MAXNAMEL+4 );
     1145        CharToOemBuffA( title, swctrl.szSwtitle, min(strlen(title),MAXNAMEL+4) );
    11441146        swctrl.szSwtitle[MAXNAMEL+4-1] = 0;
    11451147    }
  • trunk/src/user32/oslibwin.h

    r9072 r9076  
    1 /* $Id: oslibwin.h,v 1.66 2002-08-21 12:32:41 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.67 2002-08-21 15:40:28 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    259259
    260260HWND  OSLibWinQueryWindow(HWND hwnd, ULONG lCode);
    261 HWND  OSLibWinControlWindow(HWND hwndWindow, INT controlID, HWND hwndControl);
    262261
    263262LONG  OSLibWinQueryWindowTextLength(HWND hwnd);
Note: See TracChangeset for help on using the changeset viewer.