Size updates and new methods to export.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10424 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2001-06-04 19:03:35 +00:00
parent 744442dd11
commit 39c26ef2d7
3 changed files with 84 additions and 66 deletions

View File

@@ -98,6 +98,8 @@ bool wxTextCtrl::Create(
, const wxString& rsName , const wxString& rsName
) )
{ {
HWND hParent;
int nTempy;
// //
// Base initialization // Base initialization
// //
@@ -118,17 +120,33 @@ bool wxTextCtrl::Create(
if (pParent ) if (pParent )
{ {
pParent->AddChild(this); pParent->AddChild(this);
hParent = GetWinHwnd(pParent);
// //
// OS2 uses normal coordinates, no bassackwards Windows ones // OS2 uses normal coordinates, no bassackwards Windows ones
// //
// vPos.y = pParent->GetSize().y - (vPos.y + rSize.y); if (pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxScrolledWindow))
)
{
wxWindow* pGrandParent = NULL;
pGrandParent = pParent->GetParent();
if (pGrandParent)
nTempy = pGrandParent->GetSize().y - (vPos.y + rSize.y);
else
nTempy = pParent->GetSize().y - (vPos.y + rSize.y);
}
else
nTempy = pParent->GetSize().y - (vPos.y + rSize.y);
vPos.y = nTempy;
} }
else else
{ {
RECTL vRect; RECTL vRect;
::WinQueryWindowRect(HWND_DESKTOP, &vRect); ::WinQueryWindowRect(HWND_DESKTOP, &vRect);
// vPos.y = vRect.yTop - (vPos.y + rSize.y); hParent = HWND_DESKTOP;
vPos.y = vRect.yTop - (vPos.y + rSize.y);
} }
m_windowStyle = lStyle; m_windowStyle = lStyle;
@@ -161,6 +179,10 @@ bool wxTextCtrl::Create(
if (m_windowStyle & wxTE_PASSWORD) // hidden input if (m_windowStyle & wxTE_PASSWORD) // hidden input
lSstyle |= ES_UNREADABLE; lSstyle |= ES_UNREADABLE;
} }
if ( pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxScrolledWindow))
)
lSstyle |= WS_CLIPSIBLINGS;
if (m_bIsMLE) if (m_bIsMLE)
{ {
m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
@@ -221,8 +243,8 @@ bool wxTextCtrl::Create(
SetValue(rsValue); SetValue(rsValue);
} }
SetupColours(); SetupColours();
SetSize( rPos.x SetSize( vPos.x
,rPos.y ,vPos.y
,rSize.x ,rSize.x
,rSize.y ,rSize.y
); );
@@ -307,19 +329,6 @@ void wxTextCtrl::WriteText(
const wxString& rsValue const wxString& rsValue
) )
{ {
if (m_defaultStyle.HasFont() || m_defaultStyle.HasTextColour())
{
long lStart;
long lEnd;
GetSelection( &lStart
,&lEnd
);
SetStyle( lStart
,lEnd
,m_defaultStyle
);
}
::WinSetWindowText(GetHwnd(), rsValue.c_str()); ::WinSetWindowText(GetHwnd(), rsValue.c_str());
AdjustSpaceLimit(); AdjustSpaceLimit();
} // end of wxTextCtrl::WriteText } // end of wxTextCtrl::WriteText
@@ -618,52 +627,6 @@ void wxTextCtrl::SetSelection(
::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFromChar, (USHORT)lToChar), (MPARAM)0); ::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFromChar, (USHORT)lToChar), (MPARAM)0);
} // end of wxTextCtrl::SetSelection } // end of wxTextCtrl::SetSelection
bool wxTextCtrl::SetStyle(
long lStart
, long lEnd
, const wxTextAttr& rStyle
)
{
HWND hWnd = GetHwnd();
//
// Order the range if needed
//
if (lStart > lEnd)
{
long lTmp = lStart;
lStart = lEnd;
lEnd = lTmp;
}
//
// We can only change the format of the selection, so select the range we
// want and restore the old selection later
long lStartOld;
long lEndOld;
GetSelection( &lStartOld
,&lEndOld
);
//
// But do we really have to change the selection?
//
bool bChangeSel = lStart != lStartOld || lEnd != lEndOld;
if (bChangeSel)
{
if (m_bIsMLE)
::WinSendMsg(hWnd, MLM_SETSEL, MPFROM2SHORT((USHORT)lStart, (USHORT)lEnd), 0);
else
::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lStart, (USHORT)lEnd), 0);
}
//
// TODO:: finish this by setting fonts and colors
//
return TRUE;
} // end of wxTextCtrl::SetStyle
bool wxTextCtrl::LoadFile( bool wxTextCtrl::LoadFile(
const wxString& rsFile const wxString& rsFile
) )
@@ -1268,3 +1231,50 @@ bool wxTextCtrl::SetForegroundColour(
return TRUE; return TRUE;
} // end of wxTextCtrl::SetForegroundColour } // end of wxTextCtrl::SetForegroundColour
bool wxTextCtrl::SetStyle(
long lStart
, long lEnd
, const wxTextAttr& rStyle
)
{
HWND hWnd = GetHwnd();
if (lStart > lEnd)
{
long lTmp = lStart;
lStart = lEnd;
lEnd = lTmp;
}
//
// We can only change the format of the selection, so select the range we
// want and restore the old selection later
//
long lStartOld;
long lEndOld;
GetSelection( &lStartOld
,&lEndOld
);
//
// But do we really have to change the selection?
//
bool bChangeSel = lStart != lStartOld ||
lEnd != lEndOld;
if (bChangeSel)
{
if (m_bIsMLE)
::WinSendMsg(hWnd, MLM_SETSEL, MPFROM2SHORT((USHORT)lStart, (USHORT)lEnd), 0);
else
::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lStart, (USHORT)lEnd), 0);
}
//
// TODO:: finish this part
//
return TRUE;
} // end of wxTextCtrl::SetStyle

View File

@@ -314,7 +314,6 @@ wxWindow::~wxWindow()
{ {
if (pFrame->GetLastFocus() == this) if (pFrame->GetLastFocus() == this)
pFrame->SetLastFocus((wxWindow*)NULL); pFrame->SetLastFocus((wxWindow*)NULL);
break;
} }
} }
if (m_parent) if (m_parent)
@@ -1449,6 +1448,17 @@ void wxWindow::DoMoveWindow(
, int nHeight , int nHeight
) )
{ {
RECTL vRect;
HWND hParent;
wxWindow* pParent = GetParent();
if (pParent)
hParent = GetWinHwnd(pParent);
else
hParent = HWND_DESKTOP;
::WinQueryWindowRect(hParent, &vRect);
nY = vRect.yTop - (nY + nHeight);
if ( !::WinSetWindowPos( GetHwnd() if ( !::WinSetWindowPos( GetHwnd()
,HWND_TOP ,HWND_TOP
,(LONG)nX ,(LONG)nX

View File

@@ -3915,8 +3915,6 @@ EXPORTS
OnPrevious__19wxPreviewControlBarFv OnPrevious__19wxPreviewControlBarFv
;wxPreviewControlBar::GetEventTable() const ;wxPreviewControlBar::GetEventTable() const
GetEventTable__19wxPreviewControlBarCFv GetEventTable__19wxPreviewControlBarCFv
;wxPrinterBase::ReportError(wxWindow*,wxPrintout*,char*)
ReportError__13wxPrinterBaseFP8wxWindowP10wxPrintoutPc
;wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase*,wxFrame*,const wxString&,const wxPoint&,const wxSize&,long,const wxString&) ;wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase*,wxFrame*,const wxString&,const wxPoint&,const wxSize&,long,const wxString&)
__ct__14wxPreviewFrameFP18wxPrintPreviewBaseP7wxFrameRC8wxStringRC7wxPointRC6wxSizelT3 __ct__14wxPreviewFrameFP18wxPrintPreviewBaseP7wxFrameRC8wxStringRC7wxPointRC6wxSizelT3
;wxPrintPreviewBase::PaintPage(wxWindow*,wxDC&) ;wxPrintPreviewBase::PaintPage(wxWindow*,wxDC&)