virtual int GetValue(void) const ;
virtual void SetValue(int);
+ virtual void DoGetSize( int* pnWidth
+ ,int* pnHeight
+ ) const;
void GetSize( int* pnX
,int* pnY
) const;
,long lTo
);
virtual void SetEditable(bool bEditable);
- virtual void SetFocus(void);
virtual void SetWindowStyleFlag(long lStyle);
//
virtual bool Show(bool bShow = TRUE);
virtual bool Enable(bool bEnable = TRUE);
virtual void SetFocus(void);
+ virtual void SetFocusFromKbd(void);
virtual bool Reparent(wxWindow* pNewParent);
virtual void WarpPointer( int x
,int y
SetWidth(nWidth);
SetHeight(nBmpHeight);
if (nDepth == -1)
- nDepth = 16; // wxDisplayDepth();
+ nDepth = wxDisplayDepth();
SetDepth(nDepth);
#if wxUSE_PALETTE
wxImage wxBitmap::ConvertToImage() const
{
wxImage vImage;
+ wxDC* pDC;
wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") );
long lScans;
BITMAPINFOHEADER2 vDIBh;
BITMAPINFO2 vDIBInfo;
- HDC hDCMem;
- PSZ pszData[4] = { "Display", NULL, NULL, NULL };
HPS hPSMem;
HPS hPS;
- SIZEL vSizlPage = {0,0};
HBITMAP hBitmap;
+ HBITMAP hOldBitmap;
+ DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
+ SIZEL vSizlPage = {0,0};
+ HDC hDCMem;
vImage.Create( nWidth
,nHeight
return wxNullImage;
}
+ //
+ // May already be selected into a PS
+ //
+ if ((pDC = GetSelectedInto()) != NULL)
+ {
+ hPSMem = pDC->GetHPS();
+ }
+ else
+ {
+ hDCMem = ::DevOpenDC( vHabmain
+ ,OD_MEMORY
+ ,"*"
+ ,5L
+ ,(PDEVOPENDATA)&vDop
+ ,NULLHANDLE
+ );
+ hPSMem = ::GpiCreatePS( vHabmain
+ ,hDCMem
+ ,&vSizlPage
+ ,PU_PELS | GPIA_ASSOC
+ );
+ hBitmap = (HBITMAP)GetHBITMAP();
+ if ((hOldBitmap = ::GpiSetBitmap(hPSMem, hBitmap)) == HBM_ERROR)
+ {
+ ERRORID vError;
+ wxString sError;
+
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ }
+
//
// Copy data from the device-dependent bitmap to the DIB
//
- hDCMem = ::DevOpenDC( vHabmain
- ,OD_MEMORY
- ,"*"
- ,4
- ,(PDEVOPENDATA)pszData
- ,NULLHANDLE
- );
- hPSMem = ::GpiCreatePS( vHabmain
- ,hDCMem
- ,&vSizlPage
- ,PU_PELS | GPIA_ASSOC | GPIT_MICRO
- );
- hBitmap = ::GpiCreateBitmap( hPSMem
- ,&vDIBh
- ,0L
- ,NULL
- ,NULL
- );
- ::GpiSetBitmap(hPSMem, hBitmap);
- lScans = ::GpiQueryBitmapBits( hPSMem
- ,0L
- ,(LONG)nHeight
- ,(PBYTE)lpBits
- ,&vDIBInfo
- );
+ if ((lScans = ::GpiQueryBitmapBits( hPSMem
+ ,0L
+ ,(LONG)nHeight
+ ,(PBYTE)lpBits
+ ,&vDIBInfo
+ )) == GPI_ALTERROR)
+ {
+ ERRORID vError;
+ wxString sError;
+
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
//
// Copy DIB data into the wxImage object
}
ptbits += nPadding;
}
- ::GpiSetBitmap(hPSMem, NULLHANDLE);
+ if ((pDC = GetSelectedInto()) == NULL)
+ {
+ ::GpiSetBitmap(hPSMem, NULLHANDLE);
+ ::GpiDestroyPS(hPSMem);
+ ::DevCloseDC(hDCMem);
+ }
//
// Similarly, set data according to the possible mask bitmap
//
// Memory DC/PS created, color set, data copied, and memory DC/PS deleted
//
- HDC hMemDC = ::DevOpenDC( vHabmain
- ,OD_MEMORY
- ,"*"
- ,4
- ,(PDEVOPENDATA)pszData
- ,NULLHANDLE
- );
+ HDC hMemDC = ::DevOpenDC( vHabmain
+ ,OD_MEMORY
+ ,"*"
+ ,5L
+ ,(PDEVOPENDATA)&vDop
+ ,NULLHANDLE
+ );
HPS hMemPS = ::GpiCreatePS( vHabmain
,hMemDC
,&vSizlPage
//
// Free allocated resources
//
- ::GpiDestroyPS(hPSMem);
- ::DevCloseDC(hDCMem);
free(lpBits);
return vImage;
} // end of wxBitmap::ConvertToImage
,0L
,0L
);
- //
- // Debug testing:
- //
- if (m_vSelectedBitmap != wxNullBitmap)
- {
- BITMAPINFOHEADER2 vHeader;
- BITMAPINFO2 vInfo;
-
- vHeader.cbFix = 16L;
- if (::GpiQueryBitmapInfoHeader(m_hPS, &vHeader))
- {
- int nBytesPerLine = vHeader.cBitCount/8;
- unsigned char* pucData = NULL;
- unsigned char* pucBits;
- LONG lScans = 0L;
-
- vInfo.cbFix = 16;
- vInfo.cx = vHeader.cx;
- vInfo.cy = vHeader.cy;
- vInfo.cPlanes = vHeader.cPlanes;
- vInfo.cBitCount = vHeader.cBitCount;
- pucData = (unsigned char*)malloc(nBytesPerLine * vHeight);
- pucBits = pucData;
- for (int i = 0; i < vHeight; i++)
- {
- if (i <= m_vSelectedBitmap.GetHeight())
- {
- for (int j = 0; j < vWidth; j++)
- {
- if (j <= m_vSelectedBitmap.GetWidth())
- {
- vPoint[0].x = j; vPoint[0].y = i;
- lColor = ::GpiQueryPel(m_hPS, &vPoint[0]);
- *(pucBits++) = lColor >> 24;
- *(pucBits++) = lColor >> 16;
- *(pucBits++) = lColor >> 8;
- }
- }
- }
- }
- lScans = ::GpiSetBitmapBits( m_hPS
- ,0 // Start at the bottom
- ,(LONG)vHeight // One line per scan
- ,(PBYTE)pucData
- ,&vInfo
- );
- }
- }
}
CalcBoundingBox(vX, vY);
CalcBoundingBox(vX2, vY2);
)
{
wxDC::DoDrawRectangle(vX, vY, vWidth, vHeight);
+
+ //
+ // Debug testing:
+ //
+ if (m_vSelectedBitmap.GetHBITMAP() != NULLHANDLE)
+ {
+ BITMAPINFOHEADER2 vHeader;
+ BITMAPINFO2 vInfo;
+
+ vHeader.cbFix = 16L;
+ if (::GpiQueryBitmapInfoHeader(m_vSelectedBitmap.GetHBITMAP(), &vHeader))
+ {
+ unsigned char* pucData = NULL;
+ unsigned char* pucBits;
+ int nBytesPerLine = vWidth * 3;
+ LONG lScans = 0L;
+ POINTL vPoint;
+ LONG lColor;
+
+ vInfo.cbFix = 16;
+ vInfo.cx = vHeader.cx;
+ vInfo.cy = vHeader.cy;
+ vInfo.cPlanes = vHeader.cPlanes;
+ vInfo.cBitCount = 24;
+ pucData = (unsigned char*)malloc(nBytesPerLine * m_vSelectedBitmap.GetHeight());
+ if ((lScans = ::GpiQueryBitmapBits( m_hPS
+ ,0L
+ ,(LONG)m_vSelectedBitmap.GetHeight()
+ ,(PBYTE)pucData
+ ,&vInfo
+ )) == GPI_ALTERROR)
+ {
+ ERRORID vError;
+ wxString sError;
+
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ pucBits = pucData;
+ for (int i = 0; i < m_vSelectedBitmap.GetHeight(); i++)
+ {
+ for (int j = vX; j < m_vSelectedBitmap.GetWidth(); j++)
+ {
+ if (i >= vY && j >= vX && i < vHeight && j < vWidth)
+ {
+ vPoint.x = j; vPoint.y = i;
+ if (i == vY || j == vX ||
+ i == m_vSelectedBitmap.GetWidth() -1 ||
+ j == m_vSelectedBitmap.GetHeight()
+ )
+ lColor = m_pen.GetColour().GetPixel();
+ else
+ lColor = m_brush.GetColour().GetPixel();
+ *(pucBits++) = (unsigned char)lColor;
+ *(pucBits++) = (unsigned char)(lColor >> 8);
+ *(pucBits++) = (unsigned char)(lColor >> 16);
+ }
+ else
+ pucBits += 3;
+ }
+ }
+ if ((lScans = ::GpiSetBitmapBits( m_hPS
+ ,0
+ ,(LONG)m_vSelectedBitmap.GetHeight()
+ ,(PBYTE)pucData
+ ,&vInfo
+ )) == GPI_ALTERROR)
+ {
+ ERRORID vError;
+ wxString sError;
+
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ free(pucData);
+ }
+ }
} // end of wxMemoryDC::DoDrawRectangle
+
return 0;
} // end of wxSlider::GetSelStart
+void wxSlider::DoGetSize(
+ int* pnWidth
+, int* pnHeight
+) const
+{
+ GetSize( pnWidth
+ ,pnHeight
+ );
+} // end of wxSlider::DoGetSize
+
void wxSlider::GetSize(
int* pnWidth
, int* pnHeight
rEvent.Skip();
} // end of wxTextCtrl::OnChar
-void wxTextCtrl::SetFocus()
-{
- wxTextCtrlBase::SetFocus();
- if ( !HasFlag(wxTE_MULTILINE) )
- {
- SetSelection(-1, -1);
- }
-} // end of wxTextCtrl::SetFocus
-
bool wxTextCtrl::OS2Command(
WXUINT uParam
, WXWORD WXUNUSED(vId)
::WinSetFocus(HWND_DESKTOP, hWnd);
} // end of wxWindowOS2::SetFocus
+void wxWindowOS2::SetFocusFromKbd()
+{
+ //
+ // Nothing else to do under OS/2
+ //
+ wxWindowBase::SetFocusFromKbd();
+} // end of wxWindowOS2::SetFocus
+
wxWindow* wxWindowBase::FindFocus()
{
HWND hWnd = ::WinQueryFocus(HWND_DESKTOP);
CODE LOADONCALL
EXPORTS
-;From library: F:\DEV\WX2\WXWINDOWS\LIB\wx.lib
+;From library: H:\dev\wx2\wxwindows\lib\wx.lib
;From object file: dummy.cpp
;PUBDEFs (Symbols available from object file):
wxDummyChar
wxEVT_NC_LEFT_DCLICK
wxEVT_INIT_DIALOG
wxEVT_COMMAND_SET_FOCUS
- ;From object file: F:\DEV\WX2\WXWINDOWS\src\common\extended.c
+ ;From object file: H:\DEV\WX2\WXWINDOWS\src\common\extended.c
;PUBDEFs (Symbols available from object file):
ConvertToIeeeExtended
ConvertFromIeeeExtended
Read32__17wxTextInputStreamFv
;wxTextInputStream::SkipIfEndOfLine(char)
SkipIfEndOfLine__17wxTextInputStreamFc
- ;From object file: F:\DEV\WX2\WXWINDOWS\src\common\unzip.c
+ ;From object file: H:\DEV\WX2\WXWINDOWS\src\common\unzip.c
;PUBDEFs (Symbols available from object file):
unzReadCurrentFile
unzGetCurrentFileInfo
DeleteRelatedConstraints__12wxWindowBaseFv
;wxWindowBase::SetHelpText(const wxString&)
SetHelpText__12wxWindowBaseFRC8wxString
+ ;wxGetTopLevelParent(wxWindow*)
+ wxGetTopLevelParent__FP8wxWindow
;From object file: ..\common\wxchar.cpp
;PUBDEFs (Symbols available from object file):
;wxOKlibc()
wxConstructorForwxHtmlFilterHTML__Fv
;wxHtmlFilterHTML::sm_classwxHtmlFilterHTML
sm_classwxHtmlFilterHTML__16wxHtmlFilterHTML
+ ;wxPrivate_ReadString(wxString&,wxInputStream*)
+ wxPrivate_ReadString__FR8wxStringP13wxInputStream
;wxHtmlFilterPlainText::ReadFile(const wxFSFile&) const
ReadFile__21wxHtmlFilterPlainTextCFRC8wxFSFile
;wxHtmlFilterHTML::ReadFile(const wxFSFile&) const
Copy__10wxTextCtrlFv
;wxTextCtrl::SetStyle(long,long,const wxTextAttr&)
SetStyle__10wxTextCtrlFlT1RC10wxTextAttr
- ;wxTextCtrl::SetFocus()
- SetFocus__10wxTextCtrlFv
;wxTextCtrl::CanRedo() const
CanRedo__10wxTextCtrlCFv
;wxTextCtrl::OS2GetStyle(long,unsigned long*) const
wxCharCodeOS2ToWX__Fi
;wxWindow::HandleMouseMove(int,int,unsigned int)
HandleMouseMove__8wxWindowFiT1Ui
- ;wxWindow::Raise()
- Raise__8wxWindowFv
+ ;wxWindow::SetFocusFromKbd()
+ SetFocusFromKbd__8wxWindowFv
;wxWindowCreationHook::~wxWindowCreationHook()
__dt__20wxWindowCreationHookFv
;wxWindow::Update()
Update__8wxWindowFv
;wxWindow::UnsubclassWin()
UnsubclassWin__8wxWindowFv
+ ;wxWindow::Raise()
+ Raise__8wxWindowFv
;wxWindow::Lower()
Lower__8wxWindowFv
;wxWindow::HandleMaximize()