# define WXLPARAM MPARAM
# define RECT RECTL
# define LOGFONT FATTRS
+# define LOWORD SHORT1FROMMP
+# define HIWORD SHORT2FROMMP
#endif
typedef unsigned long WXCOLORREF;
typedef void * WXRGNDATA;
/////////////////////////////////////////////////////////////////////////////
// Name: print.h
// Purpose: wxPrinter, wxPrintPreview classes
-// Author: AUTHOR
+// Author: David Webster
// Modified by:
-// Created: ??/??/98
+// Created: 10/14/99
// RCS-ID: $Id$
-// Copyright: (c) AUTHOR
-// Licence: wxWindows licence
+// Copyright: (c) David Webster
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PRINT_H_
#define _WX_PRINT_H_
-#ifdef __GNUG__
-#pragma interface "print.h"
-#endif
-
#include "wx/prntbase.h"
/*
* Represents the printer: manages printing a wxPrintout object
*/
-
+
class WXDLLEXPORT wxPrinter: public wxPrinterBase
{
DECLARE_DYNAMIC_CLASS(wxPrinter)
~wxPrinter();
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
- virtual bool PrintDialog(wxWindow *parent);
+ virtual wxDC* PrintDialog(wxWindow *parent);
virtual bool Setup(wxWindow *parent);
+private:
};
/*
* wxPrintPreview
* Programmer creates an object of this class to preview a wxPrintout.
*/
-
+
class WXDLLEXPORT wxPrintPreview: public wxPrintPreviewBase
{
DECLARE_CLASS(wxPrintPreview)
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
virtual bool OS2Command(WXUINT param, WXWORD id);
+ virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
int FindString(const wxString& s) const;
void SetSelection(int N);
void GetSize(int *x, int *y) const;
void GetPosition(int *x, int *y) const;
- void SetLabel(const wxString& label);
- void SetLabel(int item, const wxString& label) ;
+ void SetLabel(int item, const wxString& label);
+ void SetLabel(int item, wxBitmap *bitmap);
wxString GetLabel(int item) const;
- wxString GetLabel() const;
bool Show(bool show);
void SetFocus();
bool Enable(bool enable);
inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
+ // implementation only from now on
+ // -------------------------------
+
+ WXHWND *GetRadioButtons() const { return m_radioButtons; }
+ bool ContainsHWND(WXHWND hWnd) const;
+ void SendNotificationEvent();
+
+ // get the number of buttons per column/row
+ int GetNumVer() const;
+ int GetNumHor() const;
+
+#if WXWIN_COMPATIBILITY
+ wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
+ int x = -1, int y = -1, int width = -1, int height = -1,
+ int n = 0, char **choices = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr);
+#endif // WXWIN_COMPATIBILITY
+
protected:
void SubclassRadioButton(WXHWND hWndBtn);
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
+private:
+ virtual void SetLabel(const wxString& label)
+ { wxWindowBase::SetLabel(label); }
+ wxString GetLabel() const
+ { return(wxWindowBase::GetLabel()); }
};
#endif
COMTEMPTGT2=$(WXDIR)\lib\wxcom2.lib
GENTEMPTGT=$(WXDIR)\lib\wxgen.lib
NONESTEMPTGT=$(WXDIR)\lib\wxnones.lib
-OS2TEMPTGT=$(WXDIR)\lib\wxos2.lib
+OS2TEMPTGT1=$(WXDIR)\lib\wxos21.lib
+OS2TEMPTGT2=$(WXDIR)\lib\wxos22.lib
DUMMYOBJ=$D\dummy.obj
!endif
..\os2\$D\radiobut.obj \
..\os2\$D\window.obj
-OS2LIBOBJS = \
+OS2LIBOBJS1 = \
accel.obj \
app.obj \
bitmap.obj \
metafile.obj \
minifram.obj \
msgdlg.obj \
- nativdlg.obj \
+ nativdlg.obj
+
+OS2LIBOBJS2 = \
notebook.obj \
ownerdrw.obj \
palette.obj \
copy ..\generic\$D\tipdlg.obj
copy ..\generic\$D\busyinfo.obj
-$(OS2LIBOBJS):
+$(OS2LIBOBJS1):
copy ..\os2\$D\accel.obj
copy ..\os2\$D\app.obj
copy ..\os2\$D\bitmap.obj
copy ..\os2\$D\minifram.obj
copy ..\os2\$D\msgdlg.obj
copy ..\os2\$D\nativdlg.obj
+
+$(OS2LIBOBJS2):
copy ..\os2\$D\notebook.obj
copy ..\os2\$D\ownerdrw.obj
- copy ..\os2\$D\pallet.obj
+ copy ..\os2\$D\palette.obj
copy ..\os2\$D\pen.obj
copy ..\os2\$D\pnghand.obj
copy ..\os2\$D\print.obj
$**;
<<
-$(WXDIR)\lib\wxos2.lib: $(OS2LIBOBJS)
- touch $(WXDIR)\lib\wxos2.lib
- del $(WXDIR)\lib\wxos2.lib
+$(WXDIR)\lib\wxos21.lib: $(OS2LIBOBJS1)
+ touch $(WXDIR)\lib\wxos21.lib
+ del $(WXDIR)\lib\wxos21.lib
+ ilib $(LIBFLAGS) $@ @<<
+ $**;
+<<
+
+$(WXDIR)\lib\wxos22.lib: $(OS2LIBOBJS2)
+ touch $(WXDIR)\lib\wxos22.lib
+ del $(WXDIR)\lib\wxos22.lib
ilib $(LIBFLAGS) $@ @<<
$**;
<<
$(COMTEMPTGT2) \
$(GENTEMPTGT) \
$(NONESTEMPTGT) \
- $(OS2TEMPTGT) \
+ $(OS2TEMPTGT1) \
+ $(OS2TEMPTGT2) \
$(PERIPH_LIBS)
touch $(LIBTARGET)
del $(LIBTARGET)
del $(COMTEMPTGT2)
del $(GENTEMPTGT)
del $(NONESTEMPTGT)
- del $(OS2TEMPTGT)
+ del $(OS2TEMPTGT1)
+ del $(OS2TEMPTGT2)
!else
/////////////////////////////////////////////////////////////////////////////
// Name: print.cpp
// Purpose: Print framework
-// Author: AUTHOR
+// Author: David Webster
// Modified by:
-// Created: ??/??/98
+// Created: 10/14/99
// RCS-ID: $Id$
-// Copyright: (c) AUTHOR
-// Licence: wxWindows licence
+// Copyright: (c) David Webster
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#include "wx/os2/print.h"
-#include "wx/print.h"
-#include "wx/generic/printdlg.h"
+#include "wx/generic/prntdlgg.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxPrinter, wxPrinterBase)
/*
* Printer
*/
-
+
wxPrinter::wxPrinter(wxPrintData *data):
- wxPrinterBase(data)
+ wxPrinterBase((wxPrintDialogData*)data)
{
}
return FALSE;
}
-bool wxPrinter::PrintDialog(wxWindow *parent)
+wxDC* wxPrinter::PrintDialog(wxWindow *parent)
{
+// TODO:
+/*
wxPrintDialog dialog(parent, & m_printData);
- return (dialog.ShowModal() == wxID_OK);
+ return (dialog.GetPrintDC());
+*/
+ return NULL;
}
bool wxPrinter::Setup(wxWindow *parent)
{
+// TODO:
+/*
wxPrintDialog dialog(parent, & m_printData);
dialog.GetPrintData().SetSetupDialog(TRUE);
return (dialog.ShowModal() == wxID_OK);
+*/
+ return FALSE;
}
/*
{
if (!m_printPrintout)
return FALSE;
- wxPrinter printer(&m_printData);
- return printer.Print(m_previewFrame, m_printPrintout, interactive);
+// wxPrinter printer(&m_printData);
+// return printer.Print(m_previewFrame, m_printPrintout, interactive);
+ return FALSE;
}
void wxPrintPreview::DetermineScaling()
// ---------------------------------------------------------------------------
// wnd proc for radio buttons
-MRESULT _EXPORT wxRadioBtnWndProc(HWND hWnd,
- UINT message,
- MPARAM wParam,
- MPARAM lParam);
+MRESULT wxRadioBtnWndProc(HWND hWnd,
+ UINT message,
+ MPARAM wParam,
+ MPARAM lParam);
// ---------------------------------------------------------------------------
// global vars
m_majorDim = majorDim;
m_noRowsOrCols = majorDim;
- long msStyle = GROUP_FLAGS;
+ long msStyle = 0; // TODO: GROUP_FLAGS;
bool want3D;
WXDWORD exStyle = Determine3DEffects(0, &want3D);
}
// Create a dummy radio control to end the group.
- (void)CreateWindowEx(0, RADIO_CLASS, wxT(""), WS_GROUP | RADIO_FLAGS,
- 0, 0, 0, 0, hwndParent,
- (HMENU)NewControlId(), wxGetInstance(), NULL);
+// (void)CreateWindowEx(0, RADIO_CLASS, wxT(""), WS_GROUP | RADIO_FLAGS,
+// 0, 0, 0, 0, hwndParent,
+// (HMENU)NewControlId(), wxGetInstance(), NULL);
SetSelection(0);
{
if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
height = totHeight + extraHeight;
- else
+ else
height = heightOld;
}
- MoveWindow(GetHwnd(), x_offset, y_offset, width, height, TRUE);
+// TODO: MoveWindow(GetHwnd(), x_offset, y_offset, width, height, TRUE);
x_offset += cx1;
y_offset += cy1;
void wxRadioBox::GetSize(int *width, int *height) const
{
RECT rect;
- rect.left = -1; rect.right = -1; rect.top = -1; rect.bottom = -1;
+ rect.xLeft = -1; rect.xRight = -1; rect.yTop = -1; rect.yBottom = -1;
if (m_hWnd)
wxFindMaxSize(m_hWnd, &rect);
for (i = 0; i < m_noItems; i++)
wxFindMaxSize(m_radioButtons[i], &rect);
- *width = rect.right - rect.left;
- *height = rect.bottom - rect.top;
+ *width = rect.xRight - rect.xLeft;
+ *height = rect.yBottom - rect.yTop;
}
void wxRadioBox::GetPosition(int *x, int *y) const
{
wxWindow *parent = GetParent();
RECT rect;
- rect.left = -1; rect.right = -1; rect.top = -1; rect.bottom = -1;
+ rect.xLeft = -1; rect.xRight = -1; rect.yTop = -1; rect.yBottom = -1;
int i;
for (i = 0; i < m_noItems; i++)
// Since we now have the absolute screen coords,
// if there's a parent we must subtract its top left corner
- POINT point;
- point.x = rect.left;
- point.y = rect.top;
+ POINTL point;
+ point.x = rect.xLeft;
+ point.y = rect.yTop;
// TODO:
/*
if (parent)
if ( !wxControl::Show(show) )
return FALSE;
- int nCmdShow = show ? SW_SHOW : SW_HIDE;
+ int nCmdShow = 0; // TODO: show ? SW_SHOW : SW_HIDE;
for ( int i = 0; i < m_noItems; i++ )
{
// TODO: ::ShowWindow((HWND)m_radioButtons[i], nCmdShow);
// window proc for radio buttons
// ---------------------------------------------------------------------------
-MRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
- UINT msg,
- MPARAM wParam,
- MPARAM lParam)
+MRESULT wxRadioBtnWndProc(HWND hwnd,
+ UINT msg,
+ MPARAM wParam,
+ MPARAM lParam)
{
bool processed = TRUE;
- if ( msg != WM_KEYDOWN )
- processed = FALSE;
+// if ( msg != WM_KEYDOWN )
+// processed = FALSE;
if ( processed )
{
- wxRadioBox *radiobox = (wxRadioBox *)::GetWindowLong(hwnd, GWL_USERDATA);
+ wxRadioBox *radiobox = NULL; // TODO: (wxRadioBox *)::GetWindowLong(hwnd, GWL_USERDATA);
wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") );
// fall through
default:
- processed = FALSE;
+ processed = FALSE;
}
*/
if ( processed )
#include "wx/brush.h"
#endif
-#include "wx/msw/private.h"
+#include "wx/os2/private.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
,MPARAM mp1
,MPARAM mp2
);
+
+#ifdef __WXDEBUG__
+ const char *wxGetMessageName(int message);
+#endif //__WXDEBUG__
+
void wxRemoveHandleAssociation(wxWindow *win);
void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
wxWindow *wxFindWinFromHandle(WXHWND hWnd);
parent->AddChild(this);
+ bool want3D;
+ WXDWORD exStyle = 0; // TODO: Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
+ DWORD msflags = 0;
+
+
// TODO: PM Specific initialization
OS2Create(m_windowId, parent, wxCanvasClassName, this, NULL,
pos.x, pos.y,
// TODO:
}
-wxWindow* wxWindow::FindFocus()
+wxWindow* wxWindowBase::FindFocus()
{
wxWindow* window = NULL;
// TODO:
void wxWindow::SetTitle( const wxString& title)
{
- SetWindowText(GetHwnd(), title.c_str());
+// TODO: SetWindowText(GetHwnd(), title.c_str());
}
wxString wxWindow::GetTitle() const
// TODO:
return(1);
}
+#endif // WXWIN_COMPATIBILITY
int wxWindow::GetScrollPos(int orient) const
{
void wxWindow::UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *nCtlColor, WXHDC *hdc, WXHWND *hwnd)
{
- *nCtlColor = CTLCOLOR_BTN;
+ *nCtlColor = 0; // TODO: CTLCOLOR_BTN;
*hwnd = (WXHWND)lParam;
*hdc = (WXHDC)wParam;
}
void wxWindow::UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *item, WXWORD *flags, WXHMENU *hmenu)
{
- *item = (WXWORD)wParam;
+ *item = (WXWORD)LOWORD(wParam);
*flags = HIWORD(wParam);
*hmenu = (WXHMENU)lParam;
}
{
// FIXME: why do we do this?
wnd->SetHWND((WXHWND) hWnd);
- rc = wnd->OS2DefWindowProc(message, wParam, lParam );
+ rc = wnd->OS2DefWindowProc(hWnd, message, wParam, lParam );
wnd->SetHWND(0);
}
else
if ( wnd )
rc = wnd->OS2WindowProc(hWnd, message, wParam, lParam);
else
- rc = DefWindowProc( hWnd, message, wParam, lParam );
+ rc = 0; //TODO: DefWindowProc( hWnd, message, wParam, lParam );
}
return rc;
rc.result = MSWDefWindowProc(message, wParam, lParam);
}
*/
- return rc.result;
+ return (MRESULT)0;
}
// Dialog window proc
-MRESULT wxDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+MRESULT wxDlgProc(HWND hWnd, UINT message, MPARAM wParam, MPARAM lParam)
{
// TODO:
/*
return (MRESULT)0;
}
-wxList *wxWinHandleList = NULL;
wxWindow *wxFindWinFromHandle(WXHWND hWnd)
{
wxNode *node = wxWinHandleList->Find((long)hWnd);
#if wxUSE_DRAG_AND_DROP
if ( m_dropTarget != NULL )
{
- m_dropTarget->Revoke(m_hWnd);
+// m_dropTarget->Revoke(m_hWnd);
delete m_dropTarget;
m_dropTarget = NULL;
bool WXUNUSED(minimized),
WXHWND WXUNUSED(activate))
{
+ // TODO:
+ /*
wxActivateEvent event(wxEVT_ACTIVATE,
(state == WA_ACTIVE) || (state == WA_CLICKACTIVE),
m_windowId);
event.SetEventObject(this);
return GetEventHandler()->ProcessEvent(event);
+ */
+ return FALSE;
}
bool wxWindow::HandleSetFocus(WXHWND WXUNUSED(hwnd))
if ( GetHWND() == hWnd )
{
// don't set cursor when the mouse is not in the client part
+// TODO
+/*
if ( nHitTest == HTCLIENT || nHitTest == HTERROR )
{
HCURSOR hcursor = 0;
return TRUE;
}
}
+*/
}
return FALSE;
// owner drawn stuff
// ---------------------------------------------------------------------------
-bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
+bool wxWindow::OS2OnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
{
// TODO:
/*
WXLPARAM lParam)
{
WXHBRUSH hBrush = 0;
-
+// TODO:
+/*
if ( nCtlColor == CTLCOLOR_DLG )
{
hBrush = OnCtlColor(pDC, pWnd, nCtlColor, message, wParam, lParam);
*brush = hBrush;
return hBrush != 0;
+*/
+ return FALSE;
}
// Define for each class of dialog and control
bool wxWindow::HandlePaint()
{
// TODO:
- Return FALSE;
+ return FALSE;
}
bool wxWindow::HandleEraseBkgnd(WXHDC hdc)
{
// Prevents flicker when dragging
- if ( ::IsIconic(GetHwnd()) )
- return TRUE;
+// if ( ::IsIconic(GetHwnd()) )
+// return TRUE;
wxDC dc;
bool wxWindow::HandleGetMinMaxInfo(void *mmInfo)
{
+// TODO:
+/*
MINMAXINFO *info = (MINMAXINFO *)mmInfo;
bool rc = FALSE;
}
return rc;
+*/
+ return FALSE;
}
// ---------------------------------------------------------------------------
wxMenu *popupMenu = wxCurrentPopupMenu;
wxCurrentPopupMenu = NULL;
- return popupMenu->MSWCommand(cmd, id);
+ return popupMenu->OS2Command(cmd, id);
}
wxWindow *win = FindItem(id);
}
if ( win )
- return win->MSWCommand(cmd, id);
+ return win->OS2Command(cmd, id);
return FALSE;
}
void wxWindow::InitMouseEvent(wxMouseEvent& event, int x, int y, WXUINT flags)
{
+// TODO:
+/*
event.m_x = x;
event.m_y = y;
event.m_shiftDown = ((flags & MK_SHIFT) != 0);
m_lastMouseY = y;
m_lastMouseEvent = event.GetEventType();
#endif // wxUSE_MOUSEEVENT_HACK
-
+*/
}
bool wxWindow::HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags)
{
wxWindow *child = wxFindWinFromHandle(control);
if ( child )
- return child->MSWOnScroll(orientation, wParam, pos, control);
+ return child->OS2OnScroll(orientation, wParam, pos, control);
}
wxScrollWinEvent event;
// Windows keyboard hook. Allows interception of e.g. F1, ESCAPE
// in active frames and dialogs, regardless of where the focus is.
-static HHOOK wxTheKeyboardHook = 0;
-static FARPROC wxTheKeyboardHookProc = 0;
+//static HHOOK wxTheKeyboardHook = 0;
+//static FARPROC wxTheKeyboardHookProc = 0;
int wxKeyboardHook(int nCode, WORD wParam, DWORD lParam);
void wxSetKeyboardHook(bool doIt)
return NULL;
}
+#endif // __WXDEBUG__
+