Dialogs and slider updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -58,7 +58,7 @@ wxBitmapRefData::wxBitmapRefData()
|
|||||||
m_pSelectedInto = NULL;
|
m_pSelectedInto = NULL;
|
||||||
m_nNumColors = 0;
|
m_nNumColors = 0;
|
||||||
m_pBitmapMask = NULL;
|
m_pBitmapMask = NULL;
|
||||||
m_hBitmap = (WXHBITMAP) NULL;
|
m_hBitmap = (WXHBITMAP) NULL;
|
||||||
} // end of wxBitmapRefData::wxBitmapRefData
|
} // end of wxBitmapRefData::wxBitmapRefData
|
||||||
|
|
||||||
void wxBitmapRefData::Free()
|
void wxBitmapRefData::Free()
|
||||||
@@ -303,6 +303,7 @@ wxBitmap::wxBitmap(
|
|||||||
LoadFile( nId
|
LoadFile( nId
|
||||||
,(int)lType
|
,(int)lType
|
||||||
);
|
);
|
||||||
|
SetId(nId);
|
||||||
} // end of wxBitmap::wxBitmap
|
} // end of wxBitmap::wxBitmap
|
||||||
|
|
||||||
bool wxBitmap::Create(
|
bool wxBitmap::Create(
|
||||||
|
@@ -168,6 +168,8 @@ bool wxControl::OS2CreateControl(
|
|||||||
// Controls use the same font and colours as their parent dialog by default
|
// Controls use the same font and colours as their parent dialog by default
|
||||||
//
|
//
|
||||||
InheritAttributes();
|
InheritAttributes();
|
||||||
|
SetXComp(0);
|
||||||
|
SetYComp(0);
|
||||||
if (nW == 0 || nH == 0)
|
if (nW == 0 || nH == 0)
|
||||||
SetBestSize(rSize);
|
SetBestSize(rSize);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -1038,7 +1038,7 @@ void wxDC::DoDrawRectangle(
|
|||||||
if(m_brush.GetStyle() == wxTRANSPARENT)
|
if(m_brush.GetStyle() == wxTRANSPARENT)
|
||||||
lControl = DRO_OUTLINE;
|
lControl = DRO_OUTLINE;
|
||||||
|
|
||||||
::GpiSetColor(m_hPS, lColor);
|
::GpiSetColor(m_hPS, lBorderColor);
|
||||||
::GpiBox( m_hPS // handle to a presentation space
|
::GpiBox( m_hPS // handle to a presentation space
|
||||||
,lControl // draw the box outline ? or ?
|
,lControl // draw the box outline ? or ?
|
||||||
,&vPoint[1] // address of the corner
|
,&vPoint[1] // address of the corner
|
||||||
|
@@ -421,8 +421,18 @@ bool wxListBox::IsSelected(
|
|||||||
|
|
||||||
LONG lItem;
|
LONG lItem;
|
||||||
|
|
||||||
lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)N, (MPARAM)0));
|
if (GetWindowStyleFlag() & wxLB_EXTENDED)
|
||||||
return (lItem != LIT_NONE);
|
{
|
||||||
|
if (N == 0)
|
||||||
|
lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)LIT_FIRST, (MPARAM)0));
|
||||||
|
else
|
||||||
|
lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)(N - 1), (MPARAM)0));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)LIT_FIRST, (MPARAM)0));
|
||||||
|
}
|
||||||
|
return (lItem == (LONG)N && lItem != LIT_NONE);
|
||||||
} // end of wxListBox::IsSelected
|
} // end of wxListBox::IsSelected
|
||||||
|
|
||||||
wxClientData* wxListBox::DoGetItemClientObject(
|
wxClientData* wxListBox::DoGetItemClientObject(
|
||||||
|
@@ -115,13 +115,58 @@ void wxSlider::AdjustSubControls(
|
|||||||
,(LONG)nYOffset
|
,(LONG)nYOffset
|
||||||
,(LONG)nMaxLen
|
,(LONG)nMaxLen
|
||||||
,(LONG)nCy
|
,(LONG)nCy
|
||||||
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
,SWP_ZORDER | SWP_SHOW
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Now deal with a vertical slider
|
||||||
|
//
|
||||||
|
|
||||||
|
if (m_lWindowStyle & winSL_LABELS )
|
||||||
|
{
|
||||||
|
int nMinLen = 0;
|
||||||
|
int nMaxLen = 0;
|
||||||
|
|
||||||
|
::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf);
|
||||||
|
GetTextExtent(zBuf, &lMinLen, &nCyf, NULL, NULL, &this->GetFont());
|
||||||
|
|
||||||
|
::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf);
|
||||||
|
GetTextExtent(zBuf, &lMaxLen, &nCyf, NULL, NULL, &this->GetFont());
|
||||||
|
|
||||||
|
if (m_hStaticValue)
|
||||||
|
{
|
||||||
|
int nNewWidth = (DAWUTL_MAX(nMinLen, nMaxLen));
|
||||||
|
|
||||||
|
::WinSetWindowPos( (HWND)m_hStaticValue
|
||||||
|
,HWND_TOP
|
||||||
|
,(LONG)nXOffset
|
||||||
|
,(LONG)nYOffset + nHeight + nCyf
|
||||||
|
,(LONG)nNewWidth
|
||||||
|
,(LONG)nCyf
|
||||||
|
,SWP_SIZE | SWP_MOVE
|
||||||
|
);
|
||||||
|
}
|
||||||
|
::WinSetWindowPos( (HWND)m_hStaticMax
|
||||||
|
,HWND_TOP
|
||||||
|
,(LONG)nXOffset
|
||||||
|
,(LONG)nYOffset + nHeight
|
||||||
|
,(LONG)nMaxLen
|
||||||
|
,(LONG)nCyf
|
||||||
|
,SWP_SIZE | SWP_MOVE
|
||||||
|
);
|
||||||
|
::WinSetWindowPos( (HWND)m_hStaticMin
|
||||||
|
,HWND_TOP
|
||||||
|
,(LONG)nXOffset
|
||||||
|
,(LONG)nYOffset - nCyf
|
||||||
|
,(LONG)nMinLen
|
||||||
|
,(LONG)nCyf
|
||||||
|
,SWP_SIZE | SWP_MOVE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// Now deal with a vertical slider -- OS/2 doesn't have vertical sliders
|
|
||||||
//
|
|
||||||
} // end of wxSlider::AdjustSubControls
|
} // end of wxSlider::AdjustSubControls
|
||||||
|
|
||||||
void wxSlider::ClearSel()
|
void wxSlider::ClearSel()
|
||||||
@@ -239,9 +284,9 @@ bool wxSlider::Create(
|
|||||||
|
|
||||||
vSlData.cbSize = sizeof(SLDCDATA);
|
vSlData.cbSize = sizeof(SLDCDATA);
|
||||||
if (m_windowStyle & wxSL_VERTICAL)
|
if (m_windowStyle & wxSL_VERTICAL)
|
||||||
lMsStyle = SLS_VERTICAL | WS_VISIBLE | WS_TABSTOP;
|
lMsStyle = SLS_VERTICAL | SLS_HOMEBOTTOM | WS_VISIBLE | WS_TABSTOP;
|
||||||
else
|
else
|
||||||
lMsStyle = SLS_HORIZONTAL | WS_VISIBLE | WS_TABSTOP;
|
lMsStyle = SLS_HORIZONTAL | SLS_HOMELEFT| WS_VISIBLE | WS_TABSTOP;
|
||||||
|
|
||||||
if (m_windowStyle & wxCLIP_SIBLINGS)
|
if (m_windowStyle & wxCLIP_SIBLINGS)
|
||||||
lMsStyle |= WS_CLIPSIBLINGS;
|
lMsStyle |= WS_CLIPSIBLINGS;
|
||||||
@@ -264,6 +309,7 @@ bool wxSlider::Create(
|
|||||||
lMsStyle |= SLS_PRIMARYSCALE1 | SLS_PRIMARYSCALE2;
|
lMsStyle |= SLS_PRIMARYSCALE1 | SLS_PRIMARYSCALE2;
|
||||||
else
|
else
|
||||||
lMsStyle |= SLS_PRIMARYSCALE2;
|
lMsStyle |= SLS_PRIMARYSCALE2;
|
||||||
|
lMsStyle |= SLS_RIBBONSTRIP;
|
||||||
|
|
||||||
m_nPageSize = ((nMaxValue - nMinValue)/10);
|
m_nPageSize = ((nMaxValue - nMinValue)/10);
|
||||||
vSlData.usScale1Increments = m_nPageSize;
|
vSlData.usScale1Increments = m_nPageSize;
|
||||||
@@ -288,7 +334,7 @@ bool wxSlider::Create(
|
|||||||
//
|
//
|
||||||
::WinSendMsg( hScrollBar
|
::WinSendMsg( hScrollBar
|
||||||
,SLM_SETTICKSIZE
|
,SLM_SETTICKSIZE
|
||||||
,MPFROM2SHORT(SMA_SETALLTICKS, 6)
|
,MPFROM2SHORT(SMA_SETALLTICKS, (USHORT)12)
|
||||||
,NULL
|
,NULL
|
||||||
);
|
);
|
||||||
//
|
//
|
||||||
@@ -304,12 +350,7 @@ bool wxSlider::Create(
|
|||||||
SubclassWin(GetHWND());
|
SubclassWin(GetHWND());
|
||||||
::WinSetWindowText((HWND)m_hWnd, "");
|
::WinSetWindowText((HWND)m_hWnd, "");
|
||||||
|
|
||||||
wxFont* pTextFont = new wxFont( 10
|
SetFont(*wxSMALL_FONT);
|
||||||
,wxMODERN
|
|
||||||
,wxNORMAL
|
|
||||||
,wxNORMAL
|
|
||||||
);
|
|
||||||
SetFont(*pTextFont);
|
|
||||||
if (m_windowStyle & wxSL_LABELS)
|
if (m_windowStyle & wxSL_LABELS)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -412,6 +453,13 @@ bool wxSlider::Create(
|
|||||||
,sizeof(LONG)
|
,sizeof(LONG)
|
||||||
,(PVOID)&lColor
|
,(PVOID)&lColor
|
||||||
);
|
);
|
||||||
|
vColour.Set(wxString("BLUE"));
|
||||||
|
lColor = (LONG)vColour.GetPixel();
|
||||||
|
::WinSetPresParam( m_hWnd
|
||||||
|
,PP_HILITEBACKGROUNDCOLOR
|
||||||
|
,sizeof(LONG)
|
||||||
|
,(PVOID)&lColor
|
||||||
|
);
|
||||||
SetValue(nValue);
|
SetValue(nValue);
|
||||||
delete pTextFont;
|
delete pTextFont;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -515,7 +563,7 @@ void wxSlider::DoSetSize(
|
|||||||
::WinSetWindowPos( (HWND)m_hStaticMin
|
::WinSetWindowPos( (HWND)m_hStaticMin
|
||||||
,HWND_TOP
|
,HWND_TOP
|
||||||
,(LONG)nXOffset
|
,(LONG)nXOffset
|
||||||
,(LONG)nYOffset - nCyf
|
,(LONG)nYOffset - (nCyf * 1.2)
|
||||||
,(LONG)nMinLen
|
,(LONG)nMinLen
|
||||||
,(LONG)nCy
|
,(LONG)nCy
|
||||||
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
||||||
@@ -547,7 +595,7 @@ void wxSlider::DoSetSize(
|
|||||||
::WinSetWindowPos( (HWND)m_hStaticMax
|
::WinSetWindowPos( (HWND)m_hStaticMax
|
||||||
,HWND_TOP
|
,HWND_TOP
|
||||||
,(LONG)nXOffset
|
,(LONG)nXOffset
|
||||||
,(LONG)nYOffset - nCyf
|
,(LONG)nYOffset - (nCyf * 1.2)
|
||||||
,(LONG)nMaxLen
|
,(LONG)nMaxLen
|
||||||
,(LONG)nCy
|
,(LONG)nCy
|
||||||
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
||||||
@@ -606,27 +654,24 @@ void wxSlider::DoSetSize(
|
|||||||
// The height needs to be a bit bigger under Win95 if using native
|
// The height needs to be a bit bigger under Win95 if using native
|
||||||
// 3D effects.
|
// 3D effects.
|
||||||
//
|
//
|
||||||
nValueHeight = (int)(nValueHeight * 1.5);
|
|
||||||
::WinSetWindowPos( (HWND)m_hStaticValue
|
::WinSetWindowPos( (HWND)m_hStaticValue
|
||||||
,HWND_TOP
|
,HWND_TOP
|
||||||
,(LONG)nXOffset
|
,(LONG)nXOffset
|
||||||
,(LONG)nYOffset
|
,(LONG)nYOffset + lHeight
|
||||||
,(LONG)nNewWidth
|
,(LONG)nNewWidth
|
||||||
,(LONG)nValueHeight
|
,(LONG)nValueHeight
|
||||||
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
||||||
);
|
);
|
||||||
nYOffset -= nValueHeight;
|
nUsedHeight += nCy;
|
||||||
nUsedHeight += nValueHeight;
|
|
||||||
}
|
}
|
||||||
::WinSetWindowPos( (HWND)m_hStaticMin
|
::WinSetWindowPos( (HWND)m_hStaticMin
|
||||||
,HWND_TOP
|
,HWND_TOP
|
||||||
,(LONG)nXOffset
|
,(LONG)nXOffset
|
||||||
,(LONG)nYOffset
|
,(LONG)nYOffset + lHeight -lCyf
|
||||||
,(LONG)nMinLen
|
,(LONG)nMinLen
|
||||||
,(LONG)nCy
|
,(LONG)nCy
|
||||||
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
||||||
);
|
);
|
||||||
nYOffset -= nCy;
|
|
||||||
nUsedHeight += nCy;
|
nUsedHeight += nCy;
|
||||||
|
|
||||||
int nSliderLength = nHeight1 - (nUsedHeight + (2 * nCy));
|
int nSliderLength = nHeight1 - (nUsedHeight + (2 * nCy));
|
||||||
@@ -641,7 +686,7 @@ void wxSlider::DoSetSize(
|
|||||||
if (nSliderLength < 100)
|
if (nSliderLength < 100)
|
||||||
nSliderLength = 100;
|
nSliderLength = 100;
|
||||||
|
|
||||||
::WinSetWindowPos( (HWND)m_hStaticMin
|
::WinSetWindowPos( GetHwnd()
|
||||||
,HWND_TOP
|
,HWND_TOP
|
||||||
,(LONG)nXOffset
|
,(LONG)nXOffset
|
||||||
,(LONG)nYOffset
|
,(LONG)nYOffset
|
||||||
@@ -649,7 +694,6 @@ void wxSlider::DoSetSize(
|
|||||||
,(LONG)nSliderLength
|
,(LONG)nSliderLength
|
||||||
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
|
||||||
);
|
);
|
||||||
nYOffset -= nSliderLength;
|
|
||||||
nUsedHeight += nSliderLength;
|
nUsedHeight += nSliderLength;
|
||||||
::WinSetWindowPos( (HWND)m_hStaticMax
|
::WinSetWindowPos( (HWND)m_hStaticMax
|
||||||
,HWND_TOP
|
,HWND_TOP
|
||||||
|
@@ -337,8 +337,8 @@ int wxSpinCtrl::GetValue() const
|
|||||||
,SPBQ_UPDATEIFVALID
|
,SPBQ_UPDATEIFVALID
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
lVal - atol(zVal);
|
lVal = atol(zVal);
|
||||||
return lVal;
|
return (int)lVal;
|
||||||
} // end of wxSpinCtrl::GetValue
|
} // end of wxSpinCtrl::GetValue
|
||||||
|
|
||||||
void wxSpinCtrl::OnChar (
|
void wxSpinCtrl::OnChar (
|
||||||
|
@@ -32,6 +32,34 @@
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
|
||||||
|
|
||||||
|
static wxGDIImage* ConvertImage(
|
||||||
|
const wxGDIImage& rBitmap
|
||||||
|
)
|
||||||
|
{
|
||||||
|
bool bIsIcon = rBitmap.IsKindOf( CLASSINFO(wxIcon) );
|
||||||
|
|
||||||
|
if(!bIsIcon )
|
||||||
|
{
|
||||||
|
wxASSERT_MSG( wxDynamicCast(&rBitmap, wxBitmap),
|
||||||
|
_T("not an icon and not a bitmap?") );
|
||||||
|
|
||||||
|
const wxBitmap& rBmp = (const wxBitmap&)rBitmap;
|
||||||
|
wxMask* pMask = rBmp.GetMask();
|
||||||
|
|
||||||
|
if (pMask && pMask->GetMaskBitmap())
|
||||||
|
{
|
||||||
|
wxIcon* pIcon = new wxIcon;
|
||||||
|
|
||||||
|
pIcon->CopyFromBitmap(rBmp);
|
||||||
|
return pIcon;
|
||||||
|
}
|
||||||
|
return new wxBitmap(rBmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
// copying a bitmap is a cheap operation
|
||||||
|
return new wxIcon( (const wxIcon&)rBitmap );
|
||||||
|
} // end of ConvertImage
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// wxStaticBitmap
|
// wxStaticBitmap
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -46,15 +74,15 @@ bool wxStaticBitmap::Create(
|
|||||||
, const wxString& rName
|
, const wxString& rName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
ERRORID vError;
|
||||||
|
wxString sError;
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
|
|
||||||
SetName(rName);
|
SetName(rName);
|
||||||
if (pParent)
|
if (pParent)
|
||||||
pParent->AddChild(this);
|
pParent->AddChild(this);
|
||||||
|
|
||||||
m_backgroundColour = pParent->GetBackgroundColour() ;
|
|
||||||
m_foregroundColour = pParent->GetForegroundColour() ;
|
|
||||||
|
|
||||||
if (nId == -1)
|
if (nId == -1)
|
||||||
m_windowId = (int)NewControlId();
|
m_windowId = (int)NewControlId();
|
||||||
else
|
else
|
||||||
@@ -66,16 +94,21 @@ bool wxStaticBitmap::Create(
|
|||||||
int nY = rPos.y;
|
int nY = rPos.y;
|
||||||
int nWidth = rSize.x;
|
int nWidth = rSize.x;
|
||||||
int nHeight = rSize.y;
|
int nHeight = rSize.y;
|
||||||
|
char zId[16];
|
||||||
|
|
||||||
m_windowStyle = lStyle;
|
m_windowStyle = lStyle;
|
||||||
|
|
||||||
m_bIsIcon = rBitmap.IsKindOf(CLASSINFO(wxIcon));
|
m_bIsIcon = rBitmap.IsKindOf(CLASSINFO(wxIcon));
|
||||||
|
|
||||||
int nWinstyle = m_bIsIcon ? SS_ICON : SS_BITMAP;
|
//
|
||||||
|
// For now we only support an ICON
|
||||||
|
//
|
||||||
|
int nWinstyle = SS_ICON;
|
||||||
|
|
||||||
|
sprintf(zId, "#%d", rBitmap.GetId());
|
||||||
m_hWnd = (WXHWND)::WinCreateWindow( pParent->GetHWND()
|
m_hWnd = (WXHWND)::WinCreateWindow( pParent->GetHWND()
|
||||||
,WC_STATIC
|
,WC_STATIC
|
||||||
,rName.c_str()
|
,zId
|
||||||
,nWinstyle | WS_VISIBLE
|
,nWinstyle | WS_VISIBLE
|
||||||
,0,0,0,0
|
,0,0,0,0
|
||||||
,pParent->GetHWND()
|
,pParent->GetHWND()
|
||||||
@@ -84,17 +117,20 @@ bool wxStaticBitmap::Create(
|
|||||||
,NULL
|
,NULL
|
||||||
,NULL
|
,NULL
|
||||||
);
|
);
|
||||||
|
if (!m_hWnd)
|
||||||
|
{
|
||||||
|
vError = ::WinGetLastError(wxGetInstance());
|
||||||
|
sError = wxPMErrorToStr(vError);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create static bitmap") );
|
wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create static bitmap") );
|
||||||
|
m_pImage = ConvertImage(rBitmap);
|
||||||
SetImage(rBitmap);
|
m_pImage->SetHandle((WXHWND)::WinSendMsg(m_hWnd, SM_QUERYHANDLE, (MPARAM)0, (MPARAM)0));
|
||||||
|
|
||||||
// Subclass again for purposes of dialog editing mode
|
// Subclass again for purposes of dialog editing mode
|
||||||
SubclassWin(m_hWnd);
|
SubclassWin(m_hWnd);
|
||||||
SetFont(*wxSMALL_FONT);
|
return(TRUE);
|
||||||
SetSize(nX, nY, nWidth, nHeight);
|
} // end of wxStaticBitmap::Create
|
||||||
return(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxStaticBitmap::ImageIsOk() const
|
bool wxStaticBitmap::ImageIsOk() const
|
||||||
{
|
{
|
||||||
@@ -103,14 +139,17 @@ bool wxStaticBitmap::ImageIsOk() const
|
|||||||
|
|
||||||
void wxStaticBitmap::Free()
|
void wxStaticBitmap::Free()
|
||||||
{
|
{
|
||||||
delete m_pImage;
|
if (m_pImage)
|
||||||
|
delete m_pImage;
|
||||||
m_pImage = NULL;
|
m_pImage = NULL;
|
||||||
}
|
} // end of wxStaticBitmap::Free
|
||||||
|
|
||||||
wxSize wxStaticBitmap::DoGetBestSize() const
|
wxSize wxStaticBitmap::DoGetBestSize() const
|
||||||
{
|
{
|
||||||
// reuse the current size (as wxWindow does) instead of using some
|
//
|
||||||
|
// Reuse the current size (as wxWindow does) instead of using some
|
||||||
// arbitrary default size (as wxControl, our immediate base class, does)
|
// arbitrary default size (as wxControl, our immediate base class, does)
|
||||||
|
//
|
||||||
return wxWindow::DoGetBestSize();
|
return wxWindow::DoGetBestSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,54 +157,28 @@ void wxStaticBitmap::SetImage(
|
|||||||
const wxGDIImage& rBitmap
|
const wxGDIImage& rBitmap
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
int nX = 0;
|
||||||
|
int nY = 0;
|
||||||
|
int nWidth = 0;
|
||||||
|
int nHeight = 0;
|
||||||
|
|
||||||
Free();
|
Free();
|
||||||
|
|
||||||
m_bIsIcon = rBitmap.IsKindOf(CLASSINFO(wxIcon));
|
|
||||||
if (m_bIsIcon)
|
|
||||||
m_pImage = new wxIcon((const wxIcon&)rBitmap);
|
|
||||||
else
|
|
||||||
m_pImage = new wxBitmap((const wxBitmap &)rBitmap);
|
|
||||||
|
|
||||||
int nX;
|
|
||||||
int nY;
|
|
||||||
int nW;
|
|
||||||
int nH;
|
|
||||||
|
|
||||||
GetPosition(&nX, &nY);
|
|
||||||
GetSize(&nW, &nH);
|
|
||||||
|
|
||||||
::WinSendMsg( GetHwnd()
|
::WinSendMsg( GetHwnd()
|
||||||
,SM_SETHANDLE
|
,SM_SETHANDLE
|
||||||
,MPFROMHWND(m_pImage->GetHandle())
|
,MPFROMHWND(rBitmap.GetHandle())
|
||||||
,NULL
|
,NULL
|
||||||
);
|
);
|
||||||
if (ImageIsOk())
|
m_pImage = ConvertImage(rBitmap);
|
||||||
{
|
|
||||||
int nWidth = rBitmap.GetWidth();
|
|
||||||
int nHeight = rBitmap.GetHeight();
|
|
||||||
|
|
||||||
if (nWidth && nHeight)
|
GetPosition(&nX, &nY);
|
||||||
{
|
GetSize(&nWidth, &nHeight);
|
||||||
nW = nWidth;
|
|
||||||
nW = nHeight;
|
|
||||||
|
|
||||||
::WinSetWindowPos( GetHwnd()
|
|
||||||
,HWND_TOP
|
|
||||||
,nX
|
|
||||||
,nY
|
|
||||||
,nWidth
|
|
||||||
,nHeight
|
|
||||||
,SWP_SIZE | SWP_MOVE | SWP_SHOW
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RECTL vRect;
|
RECTL vRect;
|
||||||
|
|
||||||
vRect.xLeft = nW;
|
vRect.xLeft = nX;
|
||||||
vRect.yTop = nY;
|
vRect.yTop = nY;
|
||||||
vRect.xRight = nX + nW;
|
vRect.xRight = nX + nWidth;
|
||||||
vRect.yBottom = nY + nH;
|
vRect.yBottom = nY + nHeight;
|
||||||
|
|
||||||
::WinInvalidateRect(GetHwndOf(GetParent()), &vRect, TRUE);
|
::WinInvalidateRect(GetHwndOf(GetParent()), &vRect, TRUE);
|
||||||
}
|
}
|
||||||
|
@@ -60,12 +60,26 @@ bool wxStaticLine::Create(
|
|||||||
,rsName
|
,rsName
|
||||||
))
|
))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
return OS2CreateControl( _T("STATIC")
|
if (!OS2CreateControl( "STATIC"
|
||||||
,_T("")
|
,SS_FGNDFRAME
|
||||||
,rPos
|
,rPos
|
||||||
,vSize
|
,rSize
|
||||||
,lStyle
|
,rsName
|
||||||
);
|
))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
wxColour vColour;
|
||||||
|
|
||||||
|
vColour.Set(wxString("GREY"));
|
||||||
|
|
||||||
|
LONG lColor = (LONG)vColour.GetPixel();
|
||||||
|
|
||||||
|
::WinSetPresParam( m_hWnd
|
||||||
|
,PP_FOREGROUNDCOLOR
|
||||||
|
,sizeof(LONG)
|
||||||
|
,(PVOID)&lColor
|
||||||
|
);
|
||||||
|
return TRUE;
|
||||||
} // end of wxStaticLine::Create
|
} // end of wxStaticLine::Create
|
||||||
|
|
||||||
WXDWORD wxStaticLine::OS2GetStyle(
|
WXDWORD wxStaticLine::OS2GetStyle(
|
||||||
|
@@ -125,6 +125,7 @@ bool wxTextCtrl::Create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_windowStyle = lStyle;
|
m_windowStyle = lStyle;
|
||||||
|
m_bIsMLE = FALSE;
|
||||||
|
|
||||||
long lSstyle = WS_VISIBLE | WS_TABSTOP;
|
long lSstyle = WS_VISIBLE | WS_TABSTOP;
|
||||||
|
|
||||||
@@ -200,7 +201,7 @@ bool wxTextCtrl::Create(
|
|||||||
//
|
//
|
||||||
// Set font, position, size and initial value
|
// Set font, position, size and initial value
|
||||||
//
|
//
|
||||||
wxFont* pTextFont = new wxFont( 10
|
wxFont* pTextFont = new wxFont( 8
|
||||||
,wxMODERN
|
,wxMODERN
|
||||||
,wxNORMAL
|
,wxNORMAL
|
||||||
,wxNORMAL
|
,wxNORMAL
|
||||||
@@ -218,8 +219,8 @@ bool wxTextCtrl::Create(
|
|||||||
::WinQueryWindowPos(m_hWnd, &vSwp);
|
::WinQueryWindowPos(m_hWnd, &vSwp);
|
||||||
SetXComp(vSwp.x);
|
SetXComp(vSwp.x);
|
||||||
SetYComp(vSwp.y);
|
SetYComp(vSwp.y);
|
||||||
SetSize( vPos.x
|
SetSize( vPos.x - GetXComp()
|
||||||
,vPos.y
|
,vPos.y - GetYComp()
|
||||||
,rSize.x
|
,rSize.x
|
||||||
,rSize.y
|
,rSize.y
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user