m_bUseCtl3D = false;
m_bMouseInWindow = false;
m_bLastKeydownProcessed = false;
- m_pChildrenDisabled = NULL;
//
// wxWnd
//
wxRemoveHandleAssociation(this);
}
- delete m_pChildrenDisabled;
} // end of wxWindowOS2::~wxWindowOS2
// real construction (Init() must have been called before!)
return NULL;
} // wxWindowBase::DoFindFocus
-bool wxWindowOS2::Enable( bool bEnable )
+void wxWindowOS2::DoEnable( bool bEnable )
{
- if (!wxWindowBase::Enable(bEnable))
- return false;
-
HWND hWnd = GetHwnd();
-
if ( hWnd )
::WinEnableWindow(hWnd, (BOOL)bEnable);
-
- //
- // The logic below doesn't apply to the top level windows -- otherwise
- // showing a modal dialog would result in total greying out (and ungreying
- // out later) of everything which would be really ugly
- //
- if (IsTopLevel())
- return true;
-
- wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
-
- while (node)
- {
- wxWindow* pChild = node->GetData();
-
- if (bEnable)
- {
- //
- // Enable the child back unless it had been disabled before us
- //
- if (!m_pChildrenDisabled || !m_pChildrenDisabled->Find(pChild))
- pChild->Enable();
- }
- else // we're being disabled
- {
- if (pChild->IsEnabled())
- {
- //
- // Disable it as children shouldn't stay enabled while the
- // parent is not
- //
- pChild->Disable();
- }
- else // child already disabled, remember it
- {
- //
- // Have we created the list of disabled children already?
- //
- if (!m_pChildrenDisabled)
- m_pChildrenDisabled = new wxWindowList;
- m_pChildrenDisabled->Append(pChild);
- }
- }
- node = node->GetNext();
- }
- if (bEnable && m_pChildrenDisabled)
- {
- //
- // We don't need this list any more, don't keep unused memory
- //
- delete m_pChildrenDisabled;
- m_pChildrenDisabled = NULL;
- }
- return true;
-} // end of wxWindowOS2::Enable
+}
bool wxWindowOS2::Show( bool bShow )
{
void wxWindowOS2::SetLabel( const wxString& label )
{
- ::WinSetWindowText(GetHwnd(), (PSZ)label.c_str());
+ ::WinSetWindowText(GetHwnd(), label.c_str());
} // end of wxWindowOS2::SetLabel
wxString wxWindowOS2::GetLabel() const
int l;
FONTMETRICS vFM; // metrics structure
BOOL bRc = FALSE;
- char* pStr;
HPS hPS;
hPS = ::WinGetPS(GetHwnd());
l = rString.length();
if (l > 0L)
{
- pStr = (PCH)rString.c_str();
-
//
// In world coordinates.
//
bRc = ::GpiQueryTextBox( hPS,
l,
- pStr,
+ (char*) rString.wx_str(),
TXTBOX_COUNT,// return maximum information
avPoint // array of coordinates points
);
}
else
{
- wxButton* pBtn = wxDynamicCast( GetDefaultItem()
- ,wxButton
- );
+ wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
+ wxButton* pBtn = NULL;
+
+ if (tlw)
+ {
+ pBtn = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
+ }
if (pBtn && pBtn->IsEnabled())
{
);
if (!pWin->IsOfStandardClass())
{
- if (uMsg == WM_BUTTON1DOWN && pWin->AcceptsFocus() )
+ if (uMsg == WM_BUTTON1DOWN && pWin->CanAcceptFocus() )
pWin->SetFocus();
}
bProcessed = pWin->HandleMouseEvent( uMsg
}
break;
+ case CBN_LBSELECT:
case BN_CLICKED: // Dups as LN_SELECT and CBN_LBSELECT
{
HWND hWnd = ::WinWindowFromID((HWND)GetHwnd(), SHORT1FROMMP(wParam));
,(WXWORD)SHORT1FROMMP(wParam)
);
}
+ if (pWin->IsKindOf(CLASSINFO(wxChoice)))
+ {
+ wxChoice* pChoice = wxDynamicCast(pWin, wxChoice);
+
+ pChoice->OS2Command( (WXUINT)SHORT2FROMMP(wParam)
+ ,(WXWORD)SHORT1FROMMP(wParam)
+ );
+ }
return 0;
}
// break;
- case LN_ENTER: /* dups as CBN_EFCHANGE */
+ case LN_ENTER:
{
HWND hWnd = HWNDFROMMP(lParam);
wxWindowOS2* pWin = wxFindWinFromHandle(hWnd);
sClassName += wxT("NR");
}
m_hWnd = (WXHWND)::WinCreateWindow( (HWND)OS2GetParent()
- ,(PSZ)sClassName.c_str()
- ,(PSZ)(zTitle ? zTitle : wxEmptyString)
+ ,sClassName.c_str()
+ ,(zTitle ? zTitle : wxEmptyString)
,(ULONG)dwStyle
,(LONG)0L
,(LONG)0L
wxLogLastError(wxT("CreateRectRgn"));
return false;
}
-
// Get all the rectangles from the region, convert the individual
// rectangles to "the other" coordinate system and reassemble a
// region from the rectangles, to be feed into m_updateRegion.
//
- // FIXME: This is a bad hack since OS/2 API specifies that rectangles
- // passed into GpiSetRegion must not have Bottom > Top,
- // however, at first sight, it _seems_ to work nonetheless.
- //
RGNRECT vRgnData;
PRECTL pUpdateRects = NULL;
vRgnData.ulDirection = RECTDIR_LFRT_TOPBOT;
{
int rectHeight;
rectHeight = pUpdateRects[i].yTop - pUpdateRects[i].yBottom;
- pUpdateRects[i].yTop = height - pUpdateRects[i].yTop;
- pUpdateRects[i].yBottom = pUpdateRects[i].yTop + rectHeight;
+ pUpdateRects[i].yBottom = height - pUpdateRects[i].yTop;
+ pUpdateRects[i].yTop = pUpdateRects[i].yBottom + rectHeight;
}
::GpiSetRegion(hPS, hRgn, vRgnData.crc, pUpdateRects);
delete [] pUpdateRects;
}
}
-
m_updateRegion = wxRegion(hRgn, hPS);
vEvent.SetEventObject(this);