Lots of fixes for common dialogs, radioboxes, static text, checkboxes and so on.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16367 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster 2002-08-05 03:15:13 +00:00
parent 344e7ee2c5
commit b389a12d03
5 changed files with 259 additions and 199 deletions

View File

@ -34,22 +34,32 @@ wxCursorRefData::wxCursorRefData(void)
m_nWidth = 32;
m_nHeight = 32;
m_hCursor = 0 ;
m_destroyCursor = FALSE;
m_bDestroyCursor = FALSE;
}
wxCursorRefData::~wxCursorRefData(void)
void wxCursorRefData::Free()
{
// if ( m_hCursor && m_destroyCursor)
// ::DestroyCursor((HICON) m_hCursor);
}
if (m_hCursor)
{
if (m_bDestroyCursor)
::WinDestroyPointer((HPOINTER)m_hCursor);
m_hCursor = 0;
}
} // end of wxCursorRefData::Free
// Cursors
wxCursor::wxCursor(void)
{
}
wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height),
int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), const char WXUNUSED(maskBits)[])
wxCursor::wxCursor(
const char WXUNUSED(bits)[]
, int WXUNUSED(width)
, int WXUNUSED(height)
, int WXUNUSED(hotSpotX)
, int WXUNUSED(hotSpotY)
, const char WXUNUSED(maskBits)[]
)
{
}
@ -86,180 +96,221 @@ wxCursor::wxCursor(
} // end of wxCursor::wxCursor
wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY)
wxCursor::wxCursor(
const wxString& rsCursorFile
, long lFlags
, int nHotSpotX
, int nHotSpotY
)
{
m_refData = new wxCursorRefData;
wxCursorRefData* pRefData = new wxCursorRefData;
M_CURSORDATA->m_destroyCursor = FALSE;
M_CURSORDATA->m_hCursor = 0;
// TODO:
/*
M_CURSORDATA->m_bOK = FALSE;
if (flags & wxBITMAP_TYPE_CUR_RESOURCE)
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadImage(wxGetInstance(), cursor_file, IMAGE_CURSOR, 0, 0, 0);
if (M_CURSORDATA->m_hCursor)
M_CURSORDATA->m_ok = TRUE;
else
M_CURSORDATA->m_ok = FALSE;
}
else if (flags & wxBITMAP_TYPE_CUR)
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadImage(wxGetInstance(), cursor_file, IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE);
}
else if (flags & wxBITMAP_TYPE_ICO)
{
}
else if (flags & wxBITMAP_TYPE_BMP)
{
}
*/
}
pRefData = new wxCursorRefData;
m_refData = pRefData;
pRefData->m_bDestroyCursor = FALSE;
if (lFlags == wxBITMAP_TYPE_CUR_RESOURCE)
{
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)lFlags // if OS/2 this should be the resource Id
);
}
} // end of wxCursor::wxCursor
// Cursors by stock number
wxCursor::wxCursor(int cursor_type)
wxCursor::wxCursor(
int nCursorType
)
{
m_refData = new wxCursorRefData;
// TODO:
/*
switch (cursor_type)
{
case wxCURSOR_WAIT:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_WAIT);
break;
case wxCURSOR_IBEAM:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_IBEAM);
break;
case wxCURSOR_CROSS:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_CROSS);
break;
case wxCURSOR_SIZENWSE:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZENWSE);
break;
case wxCURSOR_SIZENESW:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZENESW);
break;
case wxCURSOR_SIZEWE:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZEWE);
break;
case wxCURSOR_SIZENS:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZENS);
break;
case wxCURSOR_CHAR:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
case wxCURSOR_HAND:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_HAND"));
break;
}
case wxCURSOR_BULLSEYE:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_BULLSEYE"));
break;
}
case wxCURSOR_PENCIL:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_PENCIL"));
break;
}
case wxCURSOR_MAGNIFIER:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_MAGNIFIER"));
break;
}
case wxCURSOR_NO_ENTRY:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_NO_ENTRY"));
break;
}
case wxCURSOR_LEFT_BUTTON:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
case wxCURSOR_RIGHT_BUTTON:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
case wxCURSOR_MIDDLE_BUTTON:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
case wxCURSOR_SIZING:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_SIZING"));
break;
}
case wxCURSOR_WATCH:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_WATCH"));
break;
}
case wxCURSOR_SPRAYCAN:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_ROLLER"));
break;
}
case wxCURSOR_PAINT_BRUSH:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_PBRUSH"));
break;
}
case wxCURSOR_POINT_LEFT:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_PLEFT"));
break;
}
case wxCURSOR_POINT_RIGHT:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_PRIGHT"));
break;
}
case wxCURSOR_QUESTION_ARROW:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_QARROW"));
break;
}
case wxCURSOR_BLANK:
{
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), wxT("wxCURSOR_BLANK"));
break;
}
default:
case wxCURSOR_ARROW:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
*/
}
wxCursorRefData* pRefData = new wxCursorRefData;
wxCursor::~wxCursor(void)
{
// FreeResource(TRUE);
}
m_refData = pRefData;
switch (nCursorType)
{
case wxCURSOR_ARROWWAIT:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_WAIT
,FALSE
);
break;
bool wxCursor::FreeResource(bool WXUNUSED(force))
{
// if (M_CURSORDATA && M_CURSORDATA->m_hCursor && M_CURSORDATA->m_destroyCursor)
// {
// DestroyCursor((HCURSOR) M_CURSORDATA->m_hCursor);
// M_CURSORDATA->m_hCursor = 0;
// }
return TRUE;
}
case wxCURSOR_WAIT:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_WAIT
,FALSE
);
break;
void wxCursor::SetHCURSOR(WXHCURSOR cursor)
{
if ( !M_CURSORDATA )
m_refData = new wxCursorRefData;
case wxCURSOR_IBEAM:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_TEXT
,FALSE
);
break;
M_CURSORDATA->m_hCursor = cursor;
}
case wxCURSOR_CROSS:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_MOVE
,FALSE
);
break;
case wxCURSOR_SIZENWSE:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_SIZENWSE
,FALSE
);
break;
case wxCURSOR_SIZENESW:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_SIZENESW
,FALSE
);
break;
case wxCURSOR_SIZEWE:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_SIZEWE
,FALSE
);
break;
case wxCURSOR_SIZENS:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_SIZENS
,FALSE
);
break;
case wxCURSOR_CHAR:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_ARROW
,FALSE
);
break;
case wxCURSOR_HAND:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)wxCURSOR_HAND
);
break;
case wxCURSOR_BULLSEYE:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)wxCURSOR_BULLSEYE
);
break;
case wxCURSOR_PENCIL:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)wxCURSOR_PENCIL
);
break;
case wxCURSOR_MAGNIFIER:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)wxCURSOR_MAGNIFIER
);
break;
case wxCURSOR_NO_ENTRY:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)wxCURSOR_NO_ENTRY
);
break;
case wxCURSOR_LEFT_BUTTON:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_ARROW
,FALSE
);
break;
case wxCURSOR_RIGHT_BUTTON:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_ARROW
,FALSE
);
break;
case wxCURSOR_MIDDLE_BUTTON:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_ARROW
,FALSE
);
break;
case wxCURSOR_SIZING:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_SIZE
,FALSE
);
break;
case wxCURSOR_WATCH:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)wxCURSOR_WATCH
);
break;
case wxCURSOR_SPRAYCAN:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)WXCURSOR_ROLLER
);
break;
case wxCURSOR_PAINT_BRUSH:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)WXCURSOR_PBRUSH
);
break;
case wxCURSOR_POINT_LEFT:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)WXCURSOR_PLEFT
);
break;
case wxCURSOR_POINT_RIGHT:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)WXCURSOR_PRIGHT
);
break;
case wxCURSOR_QUESTION_ARROW:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)WXCURSOR_QARROW
);
break;
case wxCURSOR_BLANK:
pRefData->m_hCursor = (WXHCURSOR) ::WinLoadPointer( HWND_DESKTOP
,0
,(ULONG)WXCURSOR_BLANK
);
break;
default:
case wxCURSOR_ARROW:
pRefData->m_hCursor = (WXHCURSOR) ::WinQuerySysPointer( HWND_DESKTOP
,(ULONG)SPTR_ARROW
,FALSE
);
break;
}
} // end of wxCursor::wxCursor
// Global cursor setting
void wxSetCursor(const wxCursor& cursor)

View File

@ -274,8 +274,9 @@ bool wxRadioBox::Create(
vColour.Set(wxString("BLACK"));
lColor = (LONG)vColour.GetPixel();
m_backgroundColour = pParent->GetBackgroundColour();
m_nSelectedButton = -1;
m_nNoItems = nNum;
m_nNoItems = 0;
m_nMajorDim = nMajorDim == 0 ? nNum : nMajorDim;
m_nNoRowsOrCols = nMajorDim;
@ -293,10 +294,7 @@ bool wxRadioBox::Create(
#endif
,rsName
))
return FALSE;
if (!OS2CreateControl( "STATIC"
#if RADIOBTN_PARENT_IS_RADIOBOX
,SS_GROUPBOX | WS_GROUP | WS_CLIPCHILDREN
@ -307,6 +305,7 @@ bool wxRadioBox::Create(
,rSize
,rsTitle
))
return FALSE;
#if RADIOBTN_PARENT_IS_RADIOBOX
HWND hWndParent = GetHwnd();
@ -318,6 +317,7 @@ bool wxRadioBox::Create(
//
// Some radio boxes test consecutive id.
//
m_nNoItems = nNum;
(void)NewControlId();
m_ahRadioButtons = new WXHWND[nNum];
m_pnRadioWidth = new int[nNum];
@ -403,6 +403,8 @@ bool wxRadioBox::Create(
,sizeof(LONG)
,(PVOID)&lColor
);
SetXComp(0);
SetYComp(0);
SetSelection(0);
SetSize( rPos.x
,rPos.y
@ -462,7 +464,10 @@ void wxRadioBox::DoSetSize(
nXx = nCurrentX;
if (nY == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
nYy = nCurrentY;
if (nYy < 0)
nYy = 0;
if (nXx < 0)
nXx = 0;
wxGetCharSize( m_hWnd
,&nCx1
@ -627,6 +632,7 @@ void wxRadioBox::DoSetSize(
,(LONG)nMaxHeight
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
);
GetParent()->Refresh();
//
// Where do we put the next button?
//

View File

@ -722,15 +722,6 @@ bool wxTopLevelWindowOS2::Show(
::WinQueryWindowPos(hWndParent, &vSwp);
m_bIconized = vSwp.fl & SWP_MINIMIZE;
if (hWndParent)
::WinSetWindowPos( hWndParent
,HWND_TOP
,vSwp.x
,vSwp.y
,vSwp.cx
,vSwp.cy
,SWP_ZORDER | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE
);
::WinEnableWindow(hWndParent, TRUE);
}
}

View File

@ -2870,6 +2870,11 @@ MRESULT wxWindowOS2::OS2WindowProc(
HWND hWnd = ::WinWindowFromID(GetHWND(), SHORT1FROMMP(wParam));
wxWindowOS2* pChild = wxFindWinFromHandle(hWnd);
if (!pChild)
{
bProcessed = FALSE;
break;
}
if (pChild->IsKindOf(CLASSINFO(wxSlider)))
bProcessed = OS2OnScroll( wxVERTICAL
,(int)SHORT2FROMMP(wParam)
@ -3933,6 +3938,8 @@ bool wxWindowOS2::HandleMouseEvent(
, WXUINT uFlags
)
{
bool bProcessed = FALSE;
//
// The mouse events take consecutive IDs from WM_MOUSEFIRST to
// WM_MOUSELAST, so it's enough to substract WM_MOUSEMOVE == WM_MOUSEFIRST
@ -3961,6 +3968,18 @@ bool wxWindowOS2::HandleMouseEvent(
,uFlags
);
bProcessed = GetEventHandler()->ProcessEvent(vEvent);
if (!bProcessed)
{
HPOINTER hPtr = ::WinQuerySysPointer(HWND_DESKTOP, SPTR_WAIT, FALSE);
HPOINTER hCursor = (HPOINTER)GetCursor().GetHCURSOR();
if (hCursor != NULLHANDLE)
{
::WinSetPointer(HWND_DESKTOP, hCursor);
bProcessed = TRUE;
}
}
return GetEventHandler()->ProcessEvent(vEvent);
} // end of wxWindowOS2::HandleMouseEvent

View File

@ -4,7 +4,7 @@ DATA MULTIPLE NONSHARED READWRITE LOADONCALL
CODE LOADONCALL
EXPORTS
;From library: F:\DEV\WX2\WXWINDOWS\LIB\WX.lib
;From library: F:\Dev\Wx2\WxWindows\LIB\wx.lib
;From object file: dummy.cpp
;PUBDEFs (Symbols available from object file):
wxDummyChar
@ -12094,27 +12094,20 @@ EXPORTS
;PUBDEFs (Symbols available from object file):
;wxCursor::wxCursor(const wxImage&)
__ct__8wxCursorFRC7wxImage
;wxCursorRefData::~wxCursorRefData()
__dt__15wxCursorRefDataFv
;wxCursor::wxCursor(const wxString&,long,int,int)
__ct__8wxCursorFRC8wxStringliT3
__vft8wxCursor8wxObject
;wxCursor::wxCursor(int)
__ct__8wxCursorFi
;wxConstructorForwxCursor()
wxConstructorForwxCursor__Fv
;wxCursorRefData::wxCursorRefData()
__ct__15wxCursorRefDataFv
;wxCursor::SetHCURSOR(unsigned long)
SetHCURSOR__8wxCursorFUl
;wxConstructorForwxCursor()
wxConstructorForwxCursor__Fv
;wxCursorRefData::Free()
Free__15wxCursorRefDataFv
;wxCursor::sm_classwxCursor
sm_classwxCursor__8wxCursor
;wxCursor::FreeResource(unsigned long)
FreeResource__8wxCursorFUl
;wxSetCursor(const wxCursor&)
wxSetCursor__FRC8wxCursor
;wxCursor::~wxCursor()
__dt__8wxCursorFv
;wxCursor::wxCursor(const char*,int,int,int,int,const char*)
__ct__8wxCursorFPCciN32T1
__vft15wxCursorRefData15wxObjectRefData