From 004fd0c8834ca526d335a9294322d9def17ef8a9 Mon Sep 17 00:00:00 2001 From: David Webster Date: Mon, 25 Oct 1999 02:41:20 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4168 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/os2/dc.h | 2 + include/wx/os2/dnd.h | 3 + include/wx/os2/frame.h | 4 +- include/wx/os2/setup.h | 4 +- include/wx/os2/setup0.h | 2 +- include/wx/tbar95.h | 4 - src/common/doslex.c | 57 ++++++- src/common/dosyacc.c | 8 +- src/common/image.cpp | 339 ++++++++++++++++++++++++++++++++++++++- src/common/lexer.l | 6 +- src/generic/dcpsg.cpp | 6 +- src/generic/helpext.cpp | 17 +- src/generic/helphtml.cpp | 6 +- src/generic/helpwxht.cpp | 10 +- src/generic/listctrl.cpp | 126 +++++++-------- src/generic/treectrl.cpp | 6 +- src/os2/clipbrd.cpp | 2 - src/os2/dnd.cpp | 20 +-- src/os2/frame.cpp | 8 + src/os2/makefile.va | 26 +-- src/os2/palette.cpp | 3 + src/os2/pen.cpp | 4 + src/os2/radiobut.cpp | 1 + src/os2/tabctrl.cpp | 2 +- src/os2/utils.cpp | 12 +- 25 files changed, 540 insertions(+), 138 deletions(-) diff --git a/include/wx/os2/dc.h b/include/wx/os2/dc.h index 225756a7a7..434082c111 100644 --- a/include/wx/os2/dc.h +++ b/include/wx/os2/dc.h @@ -216,6 +216,8 @@ protected: WXHBRUSH m_oldBrush; WXHFONT m_oldFont; WXHPALETTE m_oldPalette; + + float m_scaleFactor; // wxPSDC wants to have this. Will disappear. }; #endif // _WX_DC_H_ diff --git a/include/wx/os2/dnd.h b/include/wx/os2/dnd.h index 8517e9d86c..68be65518f 100644 --- a/include/wx/os2/dnd.h +++ b/include/wx/os2/dnd.h @@ -65,6 +65,7 @@ public: virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def); virtual bool OnDrop(wxCoord x, wxCoord y); virtual bool OnData(wxCoord x, wxCoord y); + virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult vResult); virtual bool GetData(); // implementation @@ -94,6 +95,7 @@ public: virtual bool OnData( wxCoord x ,wxCoord y ); + virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult vResult); }; // ---------------------------------------------------------------------------- @@ -115,6 +117,7 @@ public: virtual bool OnData( wxCoord x ,wxCoord y ); + virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult vResult); }; #endif //__OS2DNDH__ diff --git a/include/wx/os2/frame.h b/include/wx/os2/frame.h index e316c8f32c..4686bce84a 100644 --- a/include/wx/os2/frame.h +++ b/include/wx/os2/frame.h @@ -24,8 +24,8 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr; class WXDLLEXPORT wxMenuBar; class WXDLLEXPORT wxStatusBar; -class WXDLLEXPORT wxFrame: public wxWindow { - +class WXDLLEXPORT wxFrame: public wxWindow +{ DECLARE_DYNAMIC_CLASS(wxFrame) public: diff --git a/include/wx/os2/setup.h b/include/wx/os2/setup.h index 2e9ba2801a..52632098a1 100644 --- a/include/wx/os2/setup.h +++ b/include/wx/os2/setup.h @@ -30,7 +30,7 @@ // General features // ---------------------------------------------------------------------------- -#define wxUSE_NET_API 1 // Utilize OS/2's UPM netapi's +#define wxUSE_NET_API 0 // Utilize OS/2's UPM netapi's #define wxUSE_CONFIG 1 // Use wxConfig, with CreateConfig in wxApp @@ -70,8 +70,6 @@ #define wxUSE_DRAG_AND_DROP 1 // 0 for no drag and drop -#define wxUSE_TOOLBAR 1 - // Define 1 to use toolbar classes #define wxUSE_BUTTONBAR 1 // Define 1 to use buttonbar classes (enhanced toolbar // for MS Windows) diff --git a/include/wx/os2/setup0.h b/include/wx/os2/setup0.h index 2e9ba2801a..f3c14fe123 100644 --- a/include/wx/os2/setup0.h +++ b/include/wx/os2/setup0.h @@ -30,7 +30,7 @@ // General features // ---------------------------------------------------------------------------- -#define wxUSE_NET_API 1 // Utilize OS/2's UPM netapi's +#define wxUSE_NET_API 0 // Utilize OS/2's UPM netapi's #define wxUSE_CONFIG 1 // Use wxConfig, with CreateConfig in wxApp diff --git a/include/wx/tbar95.h b/include/wx/tbar95.h index 511220e2bd..e1aa717fd4 100644 --- a/include/wx/tbar95.h +++ b/include/wx/tbar95.h @@ -7,9 +7,5 @@ #include "wx/motif/tbar95.h" #elif defined(__WXGTK__) #include "wx/gtk/tbar95.h" -#elif defined(__WXPM__) -#include "wx/os2/tbar95.h" -#endif - #endif // _WX_TBAR95_H_BASE_ diff --git a/src/common/doslex.c b/src/common/doslex.c index 08572e333c..94234160cb 100644 --- a/src/common/doslex.c +++ b/src/common/doslex.c @@ -29,6 +29,10 @@ #include #endif +#ifdef __VISAGECPP__ +#include +#endif + #ifdef __cplusplus static int yyinput() #else @@ -131,6 +135,7 @@ int read(); * done when it reached the ';' after the YY_FATAL_ERROR() call. */ +#if !defined(__VISAGECPP__) #define YY_FATAL_ERROR(msg) \ do \ { \ @@ -139,6 +144,18 @@ int read(); exit( 1 ); \ } \ while ( 0 ) +#else +// suppress expression always false warning +int os2var = 0; +#define YY_FATAL_ERROR(msg) \ + do \ + { \ + (void) fputs( msg, stderr ); \ + (void) putc( '\n', stderr ); \ + exit( 1 ); \ + } \ + while ( os2var == 0 ) +#endif /* default yywrap function - always treat EOF as an EOF */ int yywrap(void) { return 1; } @@ -154,6 +171,7 @@ int yywrap(void) { return 1; } #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* special action meaning "start processing a new file" */ +#if !defined(__VISAGECPP__) #define YY_NEW_FILE \ do \ { \ @@ -161,11 +179,20 @@ int yywrap(void) { return 1; } yy_load_buffer_state(); \ } \ while ( 0 ) +#else +#define YY_NEW_FILE \ + do \ + { \ + yy_init_buffer( yy_current_buffer, yyin ); \ + yy_load_buffer_state(); \ + } \ + while ( os2var == 0 ) +#endif /* default declaration of generated scanner - a define so the user can * easily add parameters */ -#define YY_DECL int yylex YY_PROTO(( void )) +#define YY_DECL int yylex YY_PROTO(( void )) /* code executed at the end of each rule */ #define YY_BREAK break; @@ -246,6 +273,7 @@ static int my_unput(char); #define EOB_ACT_LAST_MATCH 2 /* return all but the first 'n' matched characters back to the input stream */ +#if !defined(__VISAGECPP__) #define yyless(n) \ do \ { \ @@ -255,6 +283,17 @@ static int my_unput(char); YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) +#else +#define yyless(n) \ + do \ + { \ + /* undo effects of setting up yytext */ \ + *yy_cp = yy_hold_char; \ + yy_c_buf_p = yy_cp = yy_bp + n; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( os2var == 0 ) +#endif #undef unput #define unput(c) yyunput( c, yytext ) @@ -477,7 +516,13 @@ YY_DECL yy_init = 0; } +#if !defined(__VISAGECPP__) while ( 1 ) /* loops until end-of-file is reached */ +#else + os2var = 1; + if (os2var == 0) return 0; + while ( os2var == 1 ) /* loops until end-of-file is reached */ +#endif { yy_cp = yy_c_buf_p; @@ -729,6 +774,10 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } } +#if defined(__VISAGECPP__) +// VA complains about proc maybe not returning a value so return one +return 0; +#endif } @@ -736,9 +785,9 @@ case YY_STATE_EOF(INITIAL): * * synopsis * int yy_get_next_buffer(); - * + * * returns a code representing an action - * EOB_ACT_LAST_MATCH - + * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ @@ -1175,7 +1224,7 @@ static int my_unput(char c) #endif -/* Public */ +/* Public */ void LexFromFile(FILE *fd) { lex_read_from_string = 0; diff --git a/src/common/dosyacc.c b/src/common/dosyacc.c index 3220c8dd7b..9515eb878c 100644 --- a/src/common/dosyacc.c +++ b/src/common/dosyacc.c @@ -4,7 +4,7 @@ static char yysccsid[] = "@(#)yaccpar 1.7 (Berkeley) 09/09/90"; #define YYBYACC 1 #line 2 "parser.y" #include "string.h" -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__VISAGECPP__) #include #endif #include "wx/expr.h" @@ -262,7 +262,8 @@ yyparse() register char *yys; extern char *getenv(); - if (yys = getenv("YYDEBUG")) + yys = getenv("YYDEBUG"); + if (yys) { yyn = *yys; if (yyn >= '0' && yyn <= '9') @@ -279,7 +280,8 @@ yyparse() *yyssp = yystate = 0; yyloop: - if (yyn = yydefred[yystate]) goto yyreduce; + yyn = yydefred[yystate]; + if (yyn != 0) goto yyreduce; if (yychar < 0) { if ((yychar = yylex()) < 0) yychar = 0; diff --git a/src/common/image.cpp b/src/common/image.cpp index 05344a678f..bb9f59afc4 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -452,9 +452,9 @@ bool wxImage::CanRead( const wxString &name ) bool wxImage::CanRead( wxInputStream &stream ) { wxList &list=GetHandlers(); - + for ( wxList::Node *node = list.GetFirst(); node; node = node->GetNext() ) - { + { wxImageHandler *handler=(wxImageHandler*)node->GetData(); if (handler->CanRead( stream )) return TRUE; @@ -1692,6 +1692,341 @@ wxImage::wxImage( const wxBitmap &bitmap ) } #endif +#ifdef __WXPM__ +// OS/2 Presentation manager conversion routings + +wxBitmap wxImage::ConvertToBitmap() const +{ + if ( !Ok() ) + return wxNullBitmap; + wxBitmap bitmap; // remove +// TODO: +/* + int sizeLimit = 1024*768*3; + + // width and height of the device-dependent bitmap + int width = GetWidth(); + int bmpHeight = GetHeight(); + + // calc the number of bytes per scanline and padding + int bytePerLine = width*3; + int sizeDWORD = sizeof( DWORD ); + int lineBoundary = bytePerLine % sizeDWORD; + int padding = 0; + if( lineBoundary > 0 ) + { + padding = sizeDWORD - lineBoundary; + bytePerLine += padding; + } + // calc the number of DIBs and heights of DIBs + int numDIB = 1; + int hRemain = 0; + int height = sizeLimit/bytePerLine; + if( height >= bmpHeight ) + height = bmpHeight; + else + { + numDIB = bmpHeight / height; + hRemain = bmpHeight % height; + if( hRemain >0 ) numDIB++; + } + + // set bitmap parameters + wxBitmap bitmap; + wxCHECK_MSG( Ok(), bitmap, wxT("invalid image") ); + bitmap.SetWidth( width ); + bitmap.SetHeight( bmpHeight ); + bitmap.SetDepth( wxDisplayDepth() ); + + // create a DIB header + int headersize = sizeof(BITMAPINFOHEADER); + LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize ); + wxCHECK_MSG( lpDIBh, bitmap, wxT("could not allocate memory for DIB header") ); + // Fill in the DIB header + lpDIBh->bmiHeader.biSize = headersize; + lpDIBh->bmiHeader.biWidth = (DWORD)width; + lpDIBh->bmiHeader.biHeight = (DWORD)(-height); + lpDIBh->bmiHeader.biSizeImage = bytePerLine*height; + // the general formula for biSizeImage: + // ( ( ( ((DWORD)width*24) +31 ) & ~31 ) >> 3 ) * height; + lpDIBh->bmiHeader.biPlanes = 1; + lpDIBh->bmiHeader.biBitCount = 24; + lpDIBh->bmiHeader.biCompression = BI_RGB; + lpDIBh->bmiHeader.biClrUsed = 0; + // These seem not really needed for our purpose here. + lpDIBh->bmiHeader.biClrImportant = 0; + lpDIBh->bmiHeader.biXPelsPerMeter = 0; + lpDIBh->bmiHeader.biYPelsPerMeter = 0; + // memory for DIB data + unsigned char *lpBits; + lpBits = (unsigned char *)malloc( lpDIBh->bmiHeader.biSizeImage ); + if( !lpBits ) + { + wxFAIL_MSG( wxT("could not allocate memory for DIB") ); + free( lpDIBh ); + return bitmap; + } + + // create and set the device-dependent bitmap + HDC hdc = ::GetDC(NULL); + HDC memdc = ::CreateCompatibleDC( hdc ); + HBITMAP hbitmap; + hbitmap = ::CreateCompatibleBitmap( hdc, width, bmpHeight ); + ::SelectObject( memdc, hbitmap); + + // copy image data into DIB data and then into DDB (in a loop) + unsigned char *data = GetData(); + int i, j, n; + int origin = 0; + unsigned char *ptdata = data; + unsigned char *ptbits; + + for( n=0; n 1 && n == numDIB-1 && hRemain > 0 ) + { + // redefine height and size of the (possibly) last smaller DIB + // memory is not reallocated + height = hRemain; + lpDIBh->bmiHeader.biHeight = (DWORD)(-height); + lpDIBh->bmiHeader.biSizeImage = bytePerLine*height; + } + ptbits = lpBits; + + for( j=0; jbmiHeader), CBM_INIT, lpBits, lpDIBh, DIB_RGB_COLORS ); + // The above line is equivalent to the following two lines. + // hbitmap = ::CreateCompatibleBitmap( hdc, width, height ); + // ::SetDIBits( hdc, hbitmap, 0, height, lpBits, lpDIBh, DIB_RGB_COLORS); + // or the following lines + // hbitmap = ::CreateCompatibleBitmap( hdc, width, height ); + // HDC memdc = ::CreateCompatibleDC( hdc ); + // ::SelectObject( memdc, hbitmap); + // ::SetDIBitsToDevice( memdc, 0, 0, width, height, + // 0, 0, 0, height, (void *)lpBits, lpDIBh, DIB_RGB_COLORS); + // ::SelectObject( memdc, 0 ); + // ::DeleteDC( memdc ); + } + bitmap.SetHBITMAP( (WXHBITMAP) hbitmap ); + + // similarly, created an mono-bitmap for the possible mask + if( HasMask() ) + { + hbitmap = ::CreateBitmap( (WORD)width, (WORD)bmpHeight, 1, 1, NULL ); + ::SelectObject( memdc, hbitmap); + if( numDIB == 1 ) height = bmpHeight; + else height = sizeLimit/bytePerLine; + lpDIBh->bmiHeader.biHeight = (DWORD)(-height); + lpDIBh->bmiHeader.biSizeImage = bytePerLine*height; + origin = 0; + unsigned char r = GetMaskRed(); + unsigned char g = GetMaskGreen(); + unsigned char b = GetMaskBlue(); + unsigned char zero = 0, one = 255; + ptdata = data; + for( n=0; n 1 && n == numDIB - 1 && hRemain > 0 ) + { + // redefine height and size of the (possibly) last smaller DIB + // memory is not reallocated + height = hRemain; + lpDIBh->bmiHeader.biHeight = (DWORD)(-height); + lpDIBh->bmiHeader.biSizeImage = bytePerLine*height; + } + ptbits = lpBits; + for( int j=0; jSetMaskBitmap( (WXHBITMAP) hbitmap ); + bitmap.SetMask( mask ); + } + + // free allocated resources + ::SelectObject( memdc, 0 ); + ::DeleteDC( memdc ); + ::ReleaseDC(NULL, hdc); + free(lpDIBh); + free(lpBits); + + // check the wxBitmap object + if( bitmap.GetHBITMAP() ) + bitmap.SetOk( TRUE ); + else + bitmap.SetOk( FALSE ); +*/ + return bitmap; +} + +wxImage::wxImage( const wxBitmap &bitmap ) +{ + // check the bitmap + if( !bitmap.Ok() ) + { + wxFAIL_MSG( wxT("invalid bitmap") ); + return; + } + + // create an wxImage object + int width = bitmap.GetWidth(); + int height = bitmap.GetHeight(); + Create( width, height ); + unsigned char *data = GetData(); + if( !data ) + { + wxFAIL_MSG( wxT("could not allocate data for image") ); + return; + } + + // calc the number of bytes per scanline and padding in the DIB + int bytePerLine = width*3; + int sizeDWORD = sizeof( DWORD ); + int lineBoundary = bytePerLine % sizeDWORD; + int padding = 0; + if( lineBoundary > 0 ) + { + padding = sizeDWORD - lineBoundary; + bytePerLine += padding; + } +// TODO: +/* + // create a DIB header + int headersize = sizeof(BITMAPINFOHEADER); + LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize ); + if( !lpDIBh ) + { + wxFAIL_MSG( wxT("could not allocate data for DIB header") ); + free( data ); + return; + } + // Fill in the DIB header + lpDIBh->bmiHeader.biSize = headersize; + lpDIBh->bmiHeader.biWidth = width; + lpDIBh->bmiHeader.biHeight = -height; + lpDIBh->bmiHeader.biSizeImage = bytePerLine * height; + lpDIBh->bmiHeader.biPlanes = 1; + lpDIBh->bmiHeader.biBitCount = 24; + lpDIBh->bmiHeader.biCompression = BI_RGB; + lpDIBh->bmiHeader.biClrUsed = 0; + // These seem not really needed for our purpose here. + lpDIBh->bmiHeader.biClrImportant = 0; + lpDIBh->bmiHeader.biXPelsPerMeter = 0; + lpDIBh->bmiHeader.biYPelsPerMeter = 0; + // memory for DIB data + unsigned char *lpBits; + lpBits = (unsigned char *) malloc( lpDIBh->bmiHeader.biSizeImage ); + if( !lpBits ) + { + wxFAIL_MSG( wxT("could not allocate data for DIB") ); + free( data ); + free( lpDIBh ); + return; + } + + // copy data from the device-dependent bitmap to the DIB + HDC hdc = ::GetDC(NULL); + HBITMAP hbitmap; + hbitmap = (HBITMAP) bitmap.GetHBITMAP(); + ::GetDIBits( hdc, hbitmap, 0, height, lpBits, lpDIBh, DIB_RGB_COLORS ); + + // copy DIB data into the wxImage object + int i, j; + unsigned char *ptdata = data; + unsigned char *ptbits = lpBits; + for( i=0; iGetMaskBitmap() ) + { + hbitmap = (HBITMAP) bitmap.GetMask()->GetMaskBitmap(); + // memory DC created, color set, data copied, and memory DC deleted + HDC memdc = ::CreateCompatibleDC( hdc ); + ::SetTextColor( memdc, RGB( 0, 0, 0 ) ); + ::SetBkColor( memdc, RGB( 255, 255, 255 ) ); + ::GetDIBits( memdc, hbitmap, 0, height, lpBits, lpDIBh, DIB_RGB_COLORS ); + ::DeleteDC( memdc ); + // background color set to RGB(16,16,16) in consistent with wxGTK + unsigned char r=16, g=16, b=16; + ptdata = data; + ptbits = lpBits; + for( i=0; i #include -#ifndef __WINDOWS__ +#if !defined(__WINDOWS__) && !defined(__OS2__) #include #endif @@ -82,7 +82,7 @@ wxExtHelpController::DisplayHelp(wxString const &relativeURL) wxBusyCursor b; // display a busy cursor -#ifdef __WXMSW__ +#if defined(__WXMSW__) wxString url; url << m_MapFile << '\\' << relativeURL.BeforeFirst('#'); bool bOk = (int)ShellExecute(NULL, "open", url, @@ -94,6 +94,19 @@ wxExtHelpController::DisplayHelp(wxString const &relativeURL) } else return true; +#elif defined(__WXPM__) + wxString url; + url << m_MapFile << '\\' << relativeURL.BeforeFirst('#'); +// will have to fix for OS/2, later.....DW +// bool bOk = (int)ShellExecute(NULL, "open", url, +// NULL, NULL, SW_SHOWNORMAL ) > 32; +// if ( !bOk ) +// { +// wxLogSysError(_("Cannot open URL '%s'"), relativeURL.c_str()); +// return false; +// } +// else + return TRUE; #else // assume UNIX wxString command; diff --git a/src/generic/helphtml.cpp b/src/generic/helphtml.cpp index 9358e52012..f8731d8d17 100644 --- a/src/generic/helphtml.cpp +++ b/src/generic/helphtml.cpp @@ -40,7 +40,7 @@ #include #endif -#ifndef __WINDOWS__ +#if !defined(__WINDOWS__) && !defined(__OS2__) #include #endif @@ -227,7 +227,7 @@ wxHTMLHelpControllerBase::DisplayContents() file = file.BeforeLast(wxT('#')); if(contents.Length() && wxFileExists(file)) rc = DisplaySection(CONTENTS_ID); - + // if not found, open homemade toc: return rc ? TRUE : KeywordSearch(wxT("")); } @@ -296,7 +296,7 @@ wxHTMLHelpControllerBase::KeywordSearch(const wxString& k) node = node->Next(); } } - + if(idx == 1) rc = DisplayHelp(urls[0]); else if(idx == 0) diff --git a/src/generic/helpwxht.cpp b/src/generic/helpwxht.cpp index dc7f167a13..b16312f6ab 100644 --- a/src/generic/helpwxht.cpp +++ b/src/generic/helpwxht.cpp @@ -40,7 +40,7 @@ #include #endif -#ifndef __WINDOWS__ +#if !defined(__WINDOWS__) && !defined(__OS2__) # include #endif @@ -69,7 +69,7 @@ public: delete [] src; return doc; } - + virtual bool CanRead(const wxFSFile& file) const { wxString filename = file.GetLocation(); @@ -158,7 +158,7 @@ wxHelpFrame::wxHelpFrame(wxWindow *parent, int id, wxButton *btn_contents = new wxButton(this, m_IdContents, _("Contents")); m_combo = new wxComboBox(this, m_IdCombo); wxButton *btn_search = new wxButton(this, m_IdSearch, _("Search")); - + m_filter = new wxForceHtmlFilter; wxLayoutConstraints *c; @@ -176,7 +176,7 @@ wxHelpFrame::wxHelpFrame(wxWindow *parent, int id, c->top.SameAs(this, wxTop, 2*LAYOUT_Y_MARGIN); c->height.AsIs(); btn_fwd->SetConstraints(c); - + c = new wxLayoutConstraints; c->left.SameAs(btn_fwd, wxRight, 2*LAYOUT_X_MARGIN); c->width.Absolute(BUTTON_WIDTH); @@ -207,7 +207,7 @@ wxHelpFrame::wxHelpFrame(wxWindow *parent, int id, m_htmlwin->SetConstraints(c); SetAutoLayout(TRUE); CreateStatusBar(); - + m_htmlwin->SetRelatedFrame(this, title); m_htmlwin->SetRelatedStatusBar(0); m_htmlwin->AddFilter(m_filter); diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 1855e79d9e..35952dc2a1 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -578,9 +578,9 @@ void wxListLineData::DoDraw( wxDC *dc, bool hilight, bool paintBG ) long dev_y = dc->LogicalToDeviceY( m_bound_all.y-2 ); long dev_w = dc->LogicalToDeviceXRel( m_bound_all.width+4 ); long dev_h = dc->LogicalToDeviceYRel( m_bound_all.height+4 ); - + if (!m_owner->IsExposed( dev_x, dev_y, dev_w, dev_h )) - { + { return; } @@ -599,7 +599,7 @@ void wxListLineData::DoDraw( wxDC *dc, bool hilight, bool paintBG ) dc->DrawRectangle( m_bound_hilight.x, m_bound_hilight.y, m_bound_hilight.width, m_bound_hilight.height ); } - + dc->SetBackgroundMode(wxTRANSPARENT); if (m_mode == wxLC_REPORT) { @@ -691,7 +691,7 @@ void wxListLineData::Draw( wxDC *dc ) bool wxListLineData::IsInRect( int x, int y, const wxRect &rect ) { - return ((x >= rect.x) && (x <= rect.x+rect.width) && + return ((x >= rect.x) && (x <= rect.x+rect.width) && (y >= rect.y) && (y <= rect.y+rect.height)); } @@ -765,7 +765,7 @@ void wxListHeaderWindow::DoDrawRect( wxDC *dc, int x, int y, int w, int h ) dc->DrawRectangle( x, y+h, w+1, 1 ); // bottom (outer) wxPen pen( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNSHADOW ), 1, wxSOLID ); - + dc->SetPen( pen ); dc->DrawLine( x+w-m_corner, y, x+w-1, y+h ); // right (inner) dc->DrawRectangle( x+1, y+h-1, w-2, 1 ); // bottom (inner) @@ -991,7 +991,7 @@ void wxListTextCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) ) if (wxPendingDelete.Member(this)) return; wxPendingDelete.Append(this); - + if ((*m_accept) && ((*m_res) != m_startValue)) m_owner->OnRenameAccept(); } @@ -1080,7 +1080,7 @@ wxListMainWindow::wxListMainWindow( wxWindow *parent, wxWindowID id, wxListMainWindow::~wxListMainWindow() { if (m_hilightBrush) delete m_hilightBrush; - + delete m_renameTimer; } @@ -1112,13 +1112,13 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) PrepareDC( dc ); if (m_dirty) return; - + if (m_lines.GetCount() == 0) return; dc.BeginDrawing(); dc.SetFont( GetFont() ); - + if (m_mode & wxLC_REPORT) { int lineSpacing = 0; @@ -1133,7 +1133,7 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) for (int i = 0; i < m_visibleLines+2; i++) { if (!node) break; - + line = (wxListLineData*)node->Data(); line->Draw( &dc ); node = node->Next(); @@ -1149,7 +1149,7 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) node = node->Next(); } } - + if (m_current) m_current->DrawRubberBand( &dc, m_hasFocus ); dc.EndDrawing(); @@ -1210,7 +1210,7 @@ void wxListMainWindow::EditLabel( long item ) { wxNode *node = m_lines.Nth( item ); wxCHECK_RET( node, wxT("wrong index in wxListCtrl::Edit()") ); - + m_currentEdit = (wxListLineData*) node->Data(); wxListEvent le( wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, GetParent()->GetId() ); @@ -1218,10 +1218,10 @@ void wxListMainWindow::EditLabel( long item ) le.m_itemIndex = GetIndexOfLine( m_currentEdit ); m_currentEdit->GetItem( 0, le.m_item ); GetParent()->GetEventHandler()->ProcessEvent( le ); - + if (!le.IsAllowed()) return; - + // We have to call this here because the label in // question might just have been added and no screen // update taken place. @@ -1234,7 +1234,7 @@ void wxListMainWindow::EditLabel( long item ) int w = 0; int h = 0; m_currentEdit->GetLabelExtent( x, y, w, h ); - + wxClientDC dc(this); PrepareDC( dc ); x = dc.LogicalToDeviceX( x ); @@ -1248,7 +1248,7 @@ void wxListMainWindow::EditLabel( long item ) void wxListMainWindow::OnRenameTimer() { wxCHECK_RET( m_current, wxT("invalid m_current") ); - + Edit( m_lines.IndexOf( m_current ) ); } @@ -1260,9 +1260,9 @@ void wxListMainWindow::OnRenameAccept() m_currentEdit->GetItem( 0, le.m_item ); le.m_item.m_text = m_renameRes; GetParent()->GetEventHandler()->ProcessEvent( le ); - + if (!le.IsAllowed()) return; - + wxListItem info; info.m_mask = wxLIST_MASK_TEXT; info.m_itemId = le.m_itemIndex; @@ -1283,7 +1283,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event ) PrepareDC(dc); long x = dc.DeviceToLogicalX( (long)event.GetX() ); long y = dc.DeviceToLogicalY( (long)event.GetY() ); - + /* Did we actually hit an item ? */ long hitResult = 0; wxNode *node = m_lines.First(); @@ -1328,9 +1328,9 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event ) m_usedKeys = FALSE; m_lastOnSame = FALSE; m_renameTimer->Stop(); - + SendNotify( line, wxEVT_COMMAND_LIST_ITEM_ACTIVATED ); - + return; } @@ -1352,13 +1352,13 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event ) SendNotify( line, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK ); return; } - + if (event.MiddleDown()) { SendNotify( line, wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK ); return; } - + if (event.LeftDown()) { m_usedKeys = FALSE; @@ -1403,12 +1403,12 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event ) } if (numOfLine < numOfCurrent) - { - int i = numOfLine; - numOfLine = numOfCurrent; - numOfCurrent = i; + { + int i = numOfLine; + numOfLine = numOfCurrent; + numOfCurrent = i; } - + wxNode *node = m_lines.Nth( numOfCurrent ); for (int i = 0; i <= numOfLine-numOfCurrent; i++) { @@ -1440,17 +1440,17 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event ) void wxListMainWindow::MoveToFocus() { if (!m_current) return; - + int x = 0; int y = 0; int w = 0; int h = 0; m_current->GetExtent( x, y, w, h ); - + int w_p = 0; int h_p = 0; GetClientSize( &w_p, &h_p ); - + if (m_mode & wxLC_REPORT) { int y_s = m_yScroll*GetScrollPos( wxVERTICAL ); @@ -1483,7 +1483,7 @@ void wxListMainWindow::OnArrowChar( wxListLineData *newCurrent, bool shiftDown ) void wxListMainWindow::OnKeyDown( wxKeyEvent &event ) { wxWindow *parent = GetParent(); - + /* we propagate the key event up */ wxKeyEvent ke( wxEVT_KEY_DOWN ); ke.m_shiftDown = event.m_shiftDown; @@ -1495,14 +1495,14 @@ void wxListMainWindow::OnKeyDown( wxKeyEvent &event ) ke.m_y = event.m_y; ke.SetEventObject( parent ); if (parent->GetEventHandler()->ProcessEvent( ke )) return; - + event.Skip(); } - + void wxListMainWindow::OnChar( wxKeyEvent &event ) { wxWindow *parent = GetParent(); - + /* we send a list_key event up */ wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetParent()->GetId() ); le.m_code = event.KeyCode(); @@ -1520,7 +1520,7 @@ void wxListMainWindow::OnChar( wxKeyEvent &event ) ke.m_y = event.m_y; ke.SetEventObject( parent ); if (parent->GetEventHandler()->ProcessEvent( ke )) return; - + if (event.KeyCode() == WXK_TAB) { wxNavigationKeyEvent nevent; @@ -1528,7 +1528,7 @@ void wxListMainWindow::OnChar( wxKeyEvent &event ) nevent.SetCurrentFocus( m_parent ); if (m_parent->GetEventHandler()->ProcessEvent( nevent )) return; } - + /* no item -> nothing to do */ if (!m_current) { @@ -1565,9 +1565,9 @@ void wxListMainWindow::OnChar( wxKeyEvent &event ) case WXK_PRIOR: { int steps = 0; - if (m_mode & wxLC_REPORT) - { - steps = m_visibleLines-1; + if (m_mode & wxLC_REPORT) + { + steps = m_visibleLines-1; } else { @@ -1584,9 +1584,9 @@ void wxListMainWindow::OnChar( wxKeyEvent &event ) case WXK_NEXT: { int steps = 0; - if (m_mode & wxLC_REPORT) - { - steps = m_visibleLines-1; + if (m_mode & wxLC_REPORT) + { + steps = m_visibleLines-1; } else { @@ -1670,7 +1670,7 @@ void wxListMainWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) ) RefreshLine( m_current ); if (!GetParent()) return; - + #ifdef __WXGTK__ g_focusWindow = GetParent(); #endif @@ -1690,7 +1690,7 @@ void wxListMainWindow::OnSize( wxSizeEvent &WXUNUSED(event) ) { /* We don't even allow the wxScrolledWindow::AdjustScrollbars() call - + */ } @@ -1898,7 +1898,7 @@ int wxListMainWindow::GetColumnWidth( int col ) } else { - return 0; + return 0; } } @@ -2101,11 +2101,11 @@ void wxListMainWindow::CalculatePositions() int iconSpacing = 0; if (m_mode & wxLC_ICON) iconSpacing = m_normal_spacing; if (m_mode & wxLC_SMALL_ICON) iconSpacing = m_small_spacing; - + // we take the first line (which also can be an icon or // an a text item in wxLC_ICON and wxLC_LIST modes) to // measure the size of the line - + int lineWidth = 0; int lineHeight = 0; int lineSpacing = 0; @@ -2150,7 +2150,7 @@ void wxListMainWindow::CalculatePositions() // at first we try without any scrollbar. if the items don't // fit into the window, we recalculate after subtracting an // approximated 15 pt for the horizontal scrollbar - + GetSize( &clientWidth, &clientHeight ); clientHeight -= 4; // sunken frame @@ -2366,9 +2366,9 @@ void wxListMainWindow::InsertItem( wxListItem &item ) else if (m_mode & wxLC_LIST) mode = wxLC_LIST; else if (m_mode & wxLC_ICON) mode = wxLC_ICON; else if (m_mode & wxLC_SMALL_ICON) mode = wxLC_ICON; // no typo - + wxListLineData *line = new wxListLineData( this, mode, m_hilightBrush ); - + if (m_mode & wxLC_REPORT) { line->InitItems( GetColumnCount() ); @@ -2378,7 +2378,7 @@ void wxListMainWindow::InsertItem( wxListItem &item ) { line->InitItems( 1 ); } - + line->SetItem( 0, item ); if ((item.m_itemId >= 0) && (item.m_itemId < (int)m_lines.GetCount())) { @@ -2414,7 +2414,7 @@ void wxListMainWindow::InsertColumn( long col, wxListItem &item ) wxListCtrlCompare list_ctrl_compare_func_2; long list_ctrl_compare_data; -int list_ctrl_compare_func_1( const void *arg1, const void *arg2 ) +int LINKAGEMODE list_ctrl_compare_func_1( const void *arg1, const void *arg2 ) { wxListLineData *line1 = *((wxListLineData**)arg1); wxListLineData *line2 = *((wxListLineData**)arg2); @@ -2520,7 +2520,7 @@ bool wxListCtrl::Create( wxWindow *parent, wxWindowID id, #if wxUSE_VALIDATORS SetValidator( validator ); #endif - + if (s & wxSUNKEN_BORDER) s -= wxSUNKEN_BORDER; m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, s ); @@ -2583,18 +2583,18 @@ void wxListCtrl::SetWindowStyleFlag( long flag ) { if (!m_headerWin) { - m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, + m_headerWin = new wxListHeaderWindow( this, -1, m_mainWin, wxPoint(0,0), wxSize(width,23), wxTAB_TRAVERSAL ); if (HasFlag(wxLC_NO_HEADER)) m_headerWin->Show( FALSE ); } else - { + { if (flag & wxLC_NO_HEADER) m_headerWin->Show( FALSE ); else m_headerWin->Show( TRUE ); - } + } } } else @@ -2605,7 +2605,7 @@ void wxListCtrl::SetWindowStyleFlag( long flag ) } } } - + wxWindow::SetWindowStyleFlag( flag ); } @@ -2999,7 +2999,7 @@ bool wxListCtrl::SetBackgroundColour( const wxColour &colour ) m_mainWin->SetBackgroundColour( colour ); m_mainWin->m_dirty = TRUE; } - + if (m_headerWin) { // m_headerWin->SetBackgroundColour( colour ); @@ -3012,13 +3012,13 @@ bool wxListCtrl::SetForegroundColour( const wxColour &colour ) { if ( !wxWindow::SetForegroundColour( colour ) ) return FALSE; - + if (m_mainWin) { m_mainWin->SetForegroundColour( colour ); m_mainWin->m_dirty = TRUE; } - + if (m_headerWin) { m_headerWin->SetForegroundColour( colour ); @@ -3031,13 +3031,13 @@ bool wxListCtrl::SetFont( const wxFont &font ) { if ( !wxWindow::SetFont( font ) ) return FALSE; - + if (m_mainWin) { m_mainWin->SetFont( font ); m_mainWin->m_dirty = TRUE; } - + if (m_headerWin) { m_headerWin->SetFont( font ); diff --git a/src/generic/treectrl.cpp b/src/generic/treectrl.cpp index 95744550b7..386ce6a72b 100644 --- a/src/generic/treectrl.cpp +++ b/src/generic/treectrl.cpp @@ -963,7 +963,7 @@ void wxTreeCtrl::Expand(const wxTreeItemId& itemId) wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_EXPANDING, GetId() ); event.m_item = item; event.SetEventObject( this ); - + // if ( ProcessEvent( event ) && event.m_code ) TODO: Was this a typo ? if ( ProcessEvent( event ) && !event.IsAllowed() ) { @@ -1285,7 +1285,7 @@ void wxTreeCtrl::ScrollTo(const wxTreeItemId &item) // FIXME: tree sorting functions are not reentrant and not MT-safe! static wxTreeCtrl *s_treeBeingSorted = NULL; -static int tree_ctrl_compare_func(wxGenericTreeItem **item1, +static int LINKAGEMODE tree_ctrl_compare_func(wxGenericTreeItem **item1, wxGenericTreeItem **item2) { wxCHECK_MSG( s_treeBeingSorted, 0, wxT("bug in wxTreeCtrl::SortChildren()") ); @@ -1939,7 +1939,7 @@ void wxTreeCtrl::OnMouse( wxMouseEvent &event ) if (item == NULL) return; /* we hit the blank area */ - if (event.RightDown()) { + if (event.RightDown()) { wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK,GetId()); nevent.m_item=item; nevent.m_code=0; diff --git a/src/os2/clipbrd.cpp b/src/os2/clipbrd.cpp index b0a54e5f24..8ffa926849 100644 --- a/src/os2/clipbrd.cpp +++ b/src/os2/clipbrd.cpp @@ -436,8 +436,6 @@ bool wxGetClipboardFormatName(wxDataFormat dataFormat, IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject) -wxClipboard* wxTheClipboard = (wxClipboard *)NULL; - wxClipboard::wxClipboard() { } diff --git a/src/os2/dnd.cpp b/src/os2/dnd.cpp index 6a54e5a39c..c37a27db55 100644 --- a/src/os2/dnd.cpp +++ b/src/os2/dnd.cpp @@ -81,6 +81,16 @@ bool wxDropTarget::OnData( return FALSE; }; +wxDragResult wxDropTarget::OnData( + wxCoord x +, wxCoord y +, wxDragResult vResult +) +{ + //TODO: + return (wxDragResult)0; +}; + bool wxDropTarget::GetData() { //TODO: @@ -99,11 +109,6 @@ bool wxDropTarget::IsAcceptable( // wxTextDropTarget // ---------------------------------------------------------------------------- -wxTextDropTarget::wxTextDropTarget() -{ - // TODO: -} - wxTextDropTarget::~wxTextDropTarget() { // TODO: @@ -122,11 +127,6 @@ bool wxTextDropTarget::OnData( // wxFileDropTarget // ---------------------------------------------------------------------------- -wxFileDropTarget::wxFileDropTarget() -{ - // TODO: -} - wxFileDropTarget::~wxFileDropTarget() { // TODO: diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index 47169e8359..80c284ad61 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -51,7 +51,9 @@ bool wxFrame::m_useNativeStatusBar = FALSE; wxFrame::wxFrame() { +#if wxUSE_TOOLBAR m_frameToolBar = NULL ; +#endif m_frameMenuBar = NULL; m_frameStatusBar = NULL; @@ -74,7 +76,9 @@ bool wxFrame::Create( wxWindow *parent SetName(name); m_windowStyle = style; m_frameMenuBar = NULL; +#if wxUSE_TOOLBAR m_frameToolBar = NULL ; +#endif m_frameStatusBar = NULL; SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); @@ -666,6 +670,7 @@ bool wxFrame::ProcessCommand(int id) wxPoint wxFrame::GetClientAreaOrigin() const { wxPoint pt(0, 0); +#if wxUSE_TOOLBAR if (GetToolBar()) { int w, h; @@ -680,6 +685,7 @@ wxPoint wxFrame::GetClientAreaOrigin() const pt.y += h; } } +#endif return pt; } @@ -905,7 +911,9 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id) if ( !m_iconized ) { PositionStatusBar(); +#if wxUSE_TOOLBAR PositionToolBar(); +#endif wxSizeEvent event(wxSize(x, y), m_windowId); event.SetEventObject( this ); diff --git a/src/os2/makefile.va b/src/os2/makefile.va index 9246affb46..66f92909dd 100644 --- a/src/os2/makefile.va +++ b/src/os2/makefile.va @@ -88,7 +88,6 @@ GENERICOBJS= \ ..\generic\$D\colrdlgg.obj \ ..\generic\$D\dcpsg.obj \ ..\generic\$D\grid.obj \ - ..\generic\$D\gridg.obj \ ..\generic\$D\helpext.obj \ ..\generic\$D\helphtml.obj \ ..\generic\$D\helpwxht.obj \ @@ -114,6 +113,7 @@ GENERICOBJS= \ ..\generic\$D\treectrl.obj \ ..\generic\$D\tipdlg.obj +# ..\generic\$D\gridg.obj \ # ..\generic\$D\notebook.obj \ GENLIBOBJS= \ @@ -123,7 +123,6 @@ GENLIBOBJS= \ colrdlgg.obj \ dcpsg.obj \ grid.obj \ - gridg.obj \ helpext.obj \ helphtml.obj \ helpwxht.obj \ @@ -462,22 +461,20 @@ OS2LIBOBJS1 = \ gsocket.obj \ helpwin.obj \ icon.obj \ - imaglist.obj \ iniconf.obj \ joystick.obj \ listbox.obj \ - listctrl.obj \ main.obj \ mdi.obj \ menu.obj \ menuitem.obj \ metafile.obj \ minifram.obj \ - msgdlg.obj + msgdlg.obj \ + nativdlg.obj \ + notebook.obj OS2LIBOBJS2 = \ - nativdlg.obj \ - notebook.obj \ ownerdrw.obj \ palette.obj \ pen.obj \ @@ -495,15 +492,13 @@ OS2LIBOBJS2 = \ statbox.obj \ stattext.obj \ statline.obj \ - statbrpm.obj \ tabctrl.obj \ taskbar.obj \ textctrl.obj \ thread.obj \ timer.obj \ - toolbar.obj \ +# toolbar.obj \ tooltip.obj \ - treectrl.obj \ utils.obj \ utilsexc.obj \ wave.obj \ @@ -663,7 +658,6 @@ $(GENLIBOBJS): copy ..\generic\$D\colrdlgg.obj copy ..\generic\$D\dcpsg.obj copy ..\generic\$D\grid.obj - copy ..\generic\$D\gridg.obj copy ..\generic\$D\helpext.obj copy ..\generic\$D\helphtml.obj copy ..\generic\$D\helpwxht.obj @@ -723,11 +717,9 @@ $(OS2LIBOBJS1): copy ..\os2\$D\gsocket.obj copy ..\os2\$D\helpwin.obj copy ..\os2\$D\icon.obj - copy ..\os2\$D\imaglist.obj copy ..\os2\$D\iniconf.obj copy ..\os2\$D\joystick.obj copy ..\os2\$D\listbox.obj - copy ..\os2\$D\listctrl.obj copy ..\os2\$D\main.obj copy ..\os2\$D\mdi.obj copy ..\os2\$D\menu.obj @@ -735,10 +727,10 @@ $(OS2LIBOBJS1): copy ..\os2\$D\metafile.obj copy ..\os2\$D\minifram.obj copy ..\os2\$D\msgdlg.obj - -$(OS2LIBOBJS2): copy ..\os2\$D\nativdlg.obj copy ..\os2\$D\notebook.obj + +$(OS2LIBOBJS2): copy ..\os2\$D\ownerdrw.obj copy ..\os2\$D\palette.obj copy ..\os2\$D\pen.obj @@ -756,15 +748,13 @@ $(OS2LIBOBJS2): copy ..\os2\$D\statbox.obj copy ..\os2\$D\statline.obj copy ..\os2\$D\stattext.obj - copy ..\os2\$D\statbrpm.obj copy ..\os2\$D\tabctrl.obj copy ..\os2\$D\taskbar.obj copy ..\os2\$D\textctrl.obj copy ..\os2\$D\thread.obj copy ..\os2\$D\timer.obj - copy ..\os2\$D\toolbar.obj +# copy ..\os2\$D\toolbar.obj copy ..\os2\$D\tooltip.obj - copy ..\os2\$D\treectrl.obj copy ..\os2\$D\utils.obj copy ..\os2\$D\utilsexc.obj copy ..\os2\$D\wave.obj diff --git a/src/os2/palette.cpp b/src/os2/palette.cpp index 0a41e354d1..cab9adfc9d 100644 --- a/src/os2/palette.cpp +++ b/src/os2/palette.cpp @@ -24,6 +24,9 @@ #include "assert.h" +#if !USE_SHARED_LIBRARIES +IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject) +#endif /* * Palette diff --git a/src/os2/pen.cpp b/src/os2/pen.cpp index c3d18a0378..ec5da7deed 100644 --- a/src/os2/pen.cpp +++ b/src/os2/pen.cpp @@ -24,6 +24,10 @@ #include "wx/os2/private.h" #include "assert.h" +#if !USE_SHARED_LIBRARIES +IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject) +#endif + wxPenRefData::wxPenRefData() { m_style = wxSOLID; diff --git a/src/os2/radiobut.cpp b/src/os2/radiobut.cpp index b69b3f1739..72cadb989a 100644 --- a/src/os2/radiobut.cpp +++ b/src/os2/radiobut.cpp @@ -27,6 +27,7 @@ #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxBitmapRadioButton, wxRadioButton) #endif bool wxRadioButton::OS2Command(WXUINT param, WXWORD id) diff --git a/src/os2/tabctrl.cpp b/src/os2/tabctrl.cpp index 677ee8a69c..ea95ab839e 100644 --- a/src/os2/tabctrl.cpp +++ b/src/os2/tabctrl.cpp @@ -25,7 +25,7 @@ #include "wx/os2/tabctrl.h" #include "wx/app.h" #include "wx/os2/private.h" -#include "wx/os2/imaglist.h" +#include "wx/generic/imaglist.h" #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl) diff --git a/src/os2/utils.cpp b/src/os2/utils.cpp index 7dbe03de3d..e837dcc66a 100644 --- a/src/os2/utils.cpp +++ b/src/os2/utils.cpp @@ -65,17 +65,17 @@ bool wxGetHostName( #if wxUSE_NET_API char zServer[256]; char zComputer[256]; - unsigned long ulLevel; + unsigned short nLevel = 0; unsigned char* zBuffer; - unsigned long ulBuffer; - unsigned long* pulTotalAvail; + unsigned short nBuffer; + unsigned short* pnTotalAvail; NetBiosGetInfo( (const unsigned char*)zServer ,(const unsigned char*)zComputer - ,ulLevel + ,nLevel ,zBuffer - ,ulBuffer - ,pulTotalAvail + ,nBuffer + ,pnTotalAvail ); strcpy(zBuf, zServer); #else -- 2.47.2