Motif: made file selector and message box properly take on background colour.

Initialised a member variable in wxDC, so e.g. bombs sample now works
and splitter displays something.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1999-10-26 15:16:29 +00:00
parent adc6fb165a
commit ee1aaf9996
6 changed files with 85 additions and 29 deletions

View File

@@ -46,6 +46,11 @@ wxDC::wxDC()
m_backgroundMode = wxTRANSPARENT;
m_isInteractive = FALSE;
m_internalDeviceOriginX = 0;
m_internalDeviceOriginY = 0;
m_externalDeviceOriginX = 0;
m_externalDeviceOriginY = 0;
}
void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y)

View File

@@ -32,6 +32,8 @@
#include <Xm/RowColumn.h>
#include <Xm/LabelG.h>
#include "wx/motif/private.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
#endif
@@ -187,8 +189,20 @@ int wxFileDialog::ShowModal()
}
else
parentWidget = (Widget) wxTheApp->GetTopLevelWidget();
// prepare the arg list
Arg args[10];
int ac = 0;
Widget fileSel = XmCreateFileSelectionDialog(parentWidget, "file_selector", NULL, 0);
wxComputeColours (XtDisplay(parentWidget), & m_backgroundColour,
(wxColour*) NULL);
XtSetArg(args[ac], XmNbackground, g_itemColors[wxBACK_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNforeground, g_itemColors[wxFORE_INDEX].pixel); ac++;
Widget fileSel = XmCreateFileSelectionDialog(parentWidget, "file_selector", args, ac);
XtUnmanageChild(XmFileSelectionBoxGetChild(fileSel, XmDIALOG_HELP_BUTTON));
Widget filterWidget = XmFileSelectionBoxGetChild(fileSel, XmDIALOG_FILTER_TEXT);
@@ -273,17 +287,10 @@ int wxFileDialog::ShowModal()
XmNresizePolicy, XmRESIZE_NONE,
NULL);
#endif
DoChangeBackgroundColour((WXWidget) fileSel, m_backgroundColour);
// DoChangeBackgroundColour((WXWidget) fileSel, m_backgroundColour);
DoChangeBackgroundColour((WXWidget) filterWidget, *wxWHITE);
DoChangeBackgroundColour((WXWidget) selectionWidget, *wxWHITE);
// apparently, this provokes a crash
#if 0
DoChangeBackgroundColour((WXWidget) okWidget, m_backgroundColour, TRUE);
DoChangeBackgroundColour((WXWidget) cancelWidget, m_backgroundColour, TRUE);
DoChangeBackgroundColour((WXWidget) applyWidget, m_backgroundColour, TRUE);
#endif
wxChangeListBoxColours(this, dirListWidget);
wxChangeListBoxColours(this, fileListWidget);

View File

@@ -125,16 +125,6 @@ int wxMessageDialog::ShowModal()
dialogCreateFunction = XmCreateInformationDialog;
}
// prepare the arg list
Arg args[2];
int ac = 0;
wxXmString text(m_message);
wxXmString title(m_caption);
XtSetArg(args[ac], XmNmessageString, text()); ac++;
XtSetArg(args[ac], XmNdialogTitle, title()); ac++;
// do create message box
Widget wParent = m_parent ? GetWidget(m_parent) : (Widget) 0;
if ( !wParent )
{
@@ -149,6 +139,25 @@ int wxMessageDialog::ShowModal()
wParent = GetWidget(window);
}
// prepare the arg list
Arg args[10];
int ac = 0;
wxXmString text(m_message);
wxXmString title(m_caption);
XtSetArg(args[ac], XmNmessageString, text()); ac++;
XtSetArg(args[ac], XmNdialogTitle, title()); ac++;
wxComputeColours (XtDisplay(wParent), & m_backgroundColour,
(wxColour*) NULL);
XtSetArg(args[ac], XmNbackground, g_itemColors[wxBACK_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNforeground, g_itemColors[wxFORE_INDEX].pixel); ac++;
// do create message box
Widget wMsgBox = (*dialogCreateFunction)(wParent, "", args, ac);
wxCHECK_MSG( wMsgBox, wxID_CANCEL, "msg box creation failed" );