WXHBRUSH m_oldBrush;
WXHFONT m_oldFont;
WXHPALETTE m_oldPalette;
+
+ float m_scaleFactor; // wxPSDC wants to have this. Will disappear.
};
#endif
// _WX_DC_H_
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
virtual bool OnData( wxCoord x
,wxCoord y
);
+ virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult vResult);
};
// ----------------------------------------------------------------------------
virtual bool OnData( wxCoord x
,wxCoord y
);
+ virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult vResult);
};
#endif //__OS2DNDH__
class WXDLLEXPORT wxMenuBar;
class WXDLLEXPORT wxStatusBar;
-class WXDLLEXPORT wxFrame: public wxWindow {
-
+class WXDLLEXPORT wxFrame: public wxWindow
+{
DECLARE_DYNAMIC_CLASS(wxFrame)
public:
// 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
#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)
// 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
#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_
#include <osfcn.h>
#endif
+#ifdef __VISAGECPP__
+#include <io.h>
+#endif
+
#ifdef __cplusplus
static int yyinput()
#else
* done when it reached the ';' after the YY_FATAL_ERROR() call.
*/
+#if !defined(__VISAGECPP__)
#define YY_FATAL_ERROR(msg) \
do \
{ \
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; }
#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 \
{ \
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;
#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 \
{ \
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 )
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;
"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
}
*
* 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
*/
#endif
-/* Public */
+/* Public */
void LexFromFile(FILE *fd)
{
lex_read_from_string = 0;
#define YYBYACC 1
#line 2 "parser.y"
#include "string.h"
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__VISAGECPP__)
#include <io.h>
#endif
#include "wx/expr.h"
register char *yys;
extern char *getenv();
- if (yys = getenv("YYDEBUG"))
+ yys = getenv("YYDEBUG");
+ if (yys)
{
yyn = *yys;
if (yyn >= '0' && yyn <= '9')
*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;
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;
}
#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<numDIB; n++ )
+ {
+ if( numDIB > 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; j<height; j++ )
+ {
+ for( i=0; i<width; i++ )
+ {
+ *(ptbits++) = *(ptdata+2);
+ *(ptbits++) = *(ptdata+1);
+ *(ptbits++) = *(ptdata );
+ ptdata += 3;
+ }
+ for( i=0; i< padding; i++ ) *(ptbits++) = 0;
+ }
+ ::StretchDIBits( memdc, 0, origin, width, height,\
+ 0, 0, width, height, lpBits, lpDIBh, DIB_RGB_COLORS, SRCCOPY);
+ origin += height;
+ // if numDIB = 1, lines below can also be used
+ // hbitmap = CreateDIBitmap( hdc, &(lpDIBh->bmiHeader), 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<numDIB; n++ )
+ {
+ if( numDIB > 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; j<height; j++ )
+ {
+ for(i=0; i<width; i++ )
+ {
+ if( (*(ptdata++)!=r) | (*(ptdata++)!=g) | (*(ptdata++)!=b) )
+ {
+ *(ptbits++) = one;
+ *(ptbits++) = one;
+ *(ptbits++) = one;
+ }
+ else
+ {
+ *(ptbits++) = zero;
+ *(ptbits++) = zero;
+ *(ptbits++) = zero;
+ }
+ }
+ for( i=0; i< padding; i++ ) *(ptbits++) = zero;
+ }
+ ::StretchDIBits( memdc, 0, origin, width, height,\
+ 0, 0, width, height, lpBits, lpDIBh, DIB_RGB_COLORS, SRCCOPY);
+ origin += height;
+ }
+ // create a wxMask object
+ wxMask *mask = new wxMask();
+ mask->SetMaskBitmap( (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; i<height; i++ )
+ {
+ for( j=0; j<width; j++ )
+ {
+ *(ptdata++) = *(ptbits+2);
+ *(ptdata++) = *(ptbits+1);
+ *(ptdata++) = *(ptbits );
+ ptbits += 3;
+ }
+ ptbits += padding;
+ }
+
+ // similarly, set data according to the possible mask bitmap
+ if( bitmap.GetMask() && bitmap.GetMask()->GetMaskBitmap() )
+ {
+ 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<height; i++ )
+ {
+ for( j=0; j<width; j++ )
+ {
+ if( *ptbits != 0 )
+ ptdata += 3;
+ else
+ {
+ *(ptdata++) = r;
+ *(ptdata++) = g;
+ *(ptdata++) = b;
+ }
+ ptbits += 3;
+ }
+ ptbits += padding;
+ }
+ SetMaskColour( r, g, b );
+ SetMask( TRUE );
+ }
+ else
+ {
+ SetMask( FALSE );
+ }
+ // free allocated resources
+ ::ReleaseDC(NULL, hdc);
+ free(lpDIBh);
+ free(lpBits);
+*/
+}
+
+#endif
+
// A module to allow wxImage initialization/cleanup
// without calling these functions from app.cpp or from
// the user's application.
"'"{WORDCHAR}*"'" {int len = strlen(yytext);
yytext[len-1] = 0;
- yylval.s = strdup(yytext+1);
+ yylval.s = strdup(yytext+1);
Return(WORD);}
\"({STRINGCHAR}|\\\"|\|\\\\|\\)*\" {yylval.s = strdup(yytext); Return(STRING);}
# define input() my_input()
static int my_unput(char c)
{
- if (lex_read_from_string) {
+ if (lex_read_from_string != 0) {
/* Make sure we have something */
if (lex_string_ptr) {
if (c == '\n') yylineno--;
#endif
-/* Public */
+/* Public */
void LexFromFile(FILE *fd)
{
lex_read_from_string = 0;
m_clipping = FALSE;
fprintf( m_pstream, "grestore\n" );
}
-
+
wxDC::DestroyClippingRegion();
}
m_signX = (xLeftRight ? 1 : -1);
m_signY = (yBottomUp ? 1 : -1);
- // FIXME there is no such function in MSW
-#ifndef __WXMSW__
+ // FIXME there is no such function in MSW nor in OS2/PM
+#if !defined(__WXMSW__) && !defined(__WXPM__)
ComputeScaleAndOrigin();
#endif
}
#include <ctype.h>
#include <sys/stat.h>
-#ifndef __WINDOWS__
+#if !defined(__WINDOWS__) && !defined(__OS2__)
#include <unistd.h>
#endif
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,
}
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;
#include <sys/stat.h>
#endif
-#ifndef __WINDOWS__
+#if !defined(__WINDOWS__) && !defined(__OS2__)
#include <unistd.h>
#endif
file = file.BeforeLast(wxT('#'));
if(contents.Length() && wxFileExists(file))
rc = DisplaySection(CONTENTS_ID);
-
+
// if not found, open homemade toc:
return rc ? TRUE : KeywordSearch(wxT(""));
}
node = node->Next();
}
}
-
+
if(idx == 1)
rc = DisplayHelp(urls[0]);
else if(idx == 0)
#include <sys/stat.h>
#endif
-#ifndef __WINDOWS__
+#if !defined(__WINDOWS__) && !defined(__OS2__)
# include <unistd.h>
#endif
delete [] src;
return doc;
}
-
+
virtual bool CanRead(const wxFSFile& file) const
{
wxString filename = file.GetLocation();
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;
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);
m_htmlwin->SetConstraints(c);
SetAutoLayout(TRUE);
CreateStatusBar();
-
+
m_htmlwin->SetRelatedFrame(this, title);
m_htmlwin->SetRelatedStatusBar(0);
m_htmlwin->AddFilter(m_filter);
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;
}
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)
{
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));
}
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)
if (wxPendingDelete.Member(this)) return;
wxPendingDelete.Append(this);
-
+
if ((*m_accept) && ((*m_res) != m_startValue))
m_owner->OnRenameAccept();
}
wxListMainWindow::~wxListMainWindow()
{
if (m_hilightBrush) delete m_hilightBrush;
-
+
delete m_renameTimer;
}
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;
for (int i = 0; i < m_visibleLines+2; i++)
{
if (!node) break;
-
+
line = (wxListLineData*)node->Data();
line->Draw( &dc );
node = node->Next();
node = node->Next();
}
}
-
+
if (m_current) m_current->DrawRubberBand( &dc, m_hasFocus );
dc.EndDrawing();
{
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() );
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.
int w = 0;
int h = 0;
m_currentEdit->GetLabelExtent( x, y, w, h );
-
+
wxClientDC dc(this);
PrepareDC( dc );
x = dc.LogicalToDeviceX( x );
void wxListMainWindow::OnRenameTimer()
{
wxCHECK_RET( m_current, wxT("invalid m_current") );
-
+
Edit( m_lines.IndexOf( m_current ) );
}
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;
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();
m_usedKeys = FALSE;
m_lastOnSame = FALSE;
m_renameTimer->Stop();
-
+
SendNotify( line, wxEVT_COMMAND_LIST_ITEM_ACTIVATED );
-
+
return;
}
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;
}
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++)
{
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 );
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;
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();
ke.m_y = event.m_y;
ke.SetEventObject( parent );
if (parent->GetEventHandler()->ProcessEvent( ke )) return;
-
+
if (event.KeyCode() == WXK_TAB)
{
wxNavigationKeyEvent nevent;
nevent.SetCurrentFocus( m_parent );
if (m_parent->GetEventHandler()->ProcessEvent( nevent )) return;
}
-
+
/* no item -> nothing to do */
if (!m_current)
{
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
{
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
{
RefreshLine( m_current );
if (!GetParent()) return;
-
+
#ifdef __WXGTK__
g_focusWindow = GetParent();
#endif
{
/*
We don't even allow the wxScrolledWindow::AdjustScrollbars() call
-
+
*/
}
}
else
{
- return 0;
+ return 0;
}
}
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;
// 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
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() );
{
line->InitItems( 1 );
}
-
+
line->SetItem( 0, item );
if ((item.m_itemId >= 0) && (item.m_itemId < (int)m_lines.GetCount()))
{
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);
#if wxUSE_VALIDATORS
SetValidator( validator );
#endif
-
+
if (s & wxSUNKEN_BORDER) s -= wxSUNKEN_BORDER;
m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, s );
{
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
}
}
}
-
+
wxWindow::SetWindowStyleFlag( flag );
}
m_mainWin->SetBackgroundColour( colour );
m_mainWin->m_dirty = TRUE;
}
-
+
if (m_headerWin)
{
// m_headerWin->SetBackgroundColour( 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 );
{
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 );
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() )
{
// 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()") );
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;
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
-wxClipboard* wxTheClipboard = (wxClipboard *)NULL;
-
wxClipboard::wxClipboard()
{
}
return FALSE;
};
+wxDragResult wxDropTarget::OnData(
+ wxCoord x
+, wxCoord y
+, wxDragResult vResult
+)
+{
+ //TODO:
+ return (wxDragResult)0;
+};
+
bool wxDropTarget::GetData()
{
//TODO:
// wxTextDropTarget
// ----------------------------------------------------------------------------
-wxTextDropTarget::wxTextDropTarget()
-{
- // TODO:
-}
-
wxTextDropTarget::~wxTextDropTarget()
{
// TODO:
// wxFileDropTarget
// ----------------------------------------------------------------------------
-wxFileDropTarget::wxFileDropTarget()
-{
- // TODO:
-}
-
wxFileDropTarget::~wxFileDropTarget()
{
// TODO:
wxFrame::wxFrame()
{
+#if wxUSE_TOOLBAR
m_frameToolBar = NULL ;
+#endif
m_frameMenuBar = NULL;
m_frameStatusBar = NULL;
SetName(name);
m_windowStyle = style;
m_frameMenuBar = NULL;
+#if wxUSE_TOOLBAR
m_frameToolBar = NULL ;
+#endif
m_frameStatusBar = NULL;
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
wxPoint wxFrame::GetClientAreaOrigin() const
{
wxPoint pt(0, 0);
+#if wxUSE_TOOLBAR
if (GetToolBar())
{
int w, h;
pt.y += h;
}
}
+#endif
return pt;
}
if ( !m_iconized )
{
PositionStatusBar();
+#if wxUSE_TOOLBAR
PositionToolBar();
+#endif
wxSizeEvent event(wxSize(x, y), m_windowId);
event.SetEventObject( this );
..\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 \
..\generic\$D\treectrl.obj \
..\generic\$D\tipdlg.obj
+# ..\generic\$D\gridg.obj \
# ..\generic\$D\notebook.obj \
GENLIBOBJS= \
colrdlgg.obj \
dcpsg.obj \
grid.obj \
- gridg.obj \
helpext.obj \
helphtml.obj \
helpwxht.obj \
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 \
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 \
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
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
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
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
#include "assert.h"
+#if !USE_SHARED_LIBRARIES
+IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject)
+#endif
/*
* Palette
#include "wx/os2/private.h"
#include "assert.h"
+#if !USE_SHARED_LIBRARIES
+IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
+#endif
+
wxPenRefData::wxPenRefData()
{
m_style = wxSOLID;
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxBitmapRadioButton, wxRadioButton)
#endif
bool wxRadioButton::OS2Command(WXUINT param, WXWORD id)
#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)
#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