Added scrollbar size to settings
Added tetsing for cursor keys to wxTextValidator Correcte misspelled colour in wxColourDialog Made print dialogs look nicer Made wxStatixBox transparent (in the middle) for mouse actions (very useful for DialogEd) Corrected colour setting in DialogEd not to set any colour when using standard colour Corretced unresponding scrollbar in DialogEd git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifndef __GTKSETTINGSH__
|
#ifndef __GTKSETTINGSH__
|
||||||
#define __GTKSETTINGSH__
|
#define __GTKSETTINGSH__
|
||||||
|
|
||||||
@@ -20,10 +19,10 @@
|
|||||||
#include "wx/pen.h"
|
#include "wx/pen.h"
|
||||||
#include "wx/font.h"
|
#include "wx/font.h"
|
||||||
|
|
||||||
class WXDLLEXPORT wxSystemSettings: public wxObject
|
class wxSystemSettings: public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline wxSystemSettings(void) {}
|
inline wxSystemSettings() {}
|
||||||
|
|
||||||
inline static void Init() {}
|
inline static void Init() {}
|
||||||
static void Done();
|
static void Done();
|
||||||
|
@@ -307,7 +307,7 @@ public:
|
|||||||
wxCursor *m_cursor;
|
wxCursor *m_cursor;
|
||||||
wxFont m_font;
|
wxFont m_font;
|
||||||
wxColour m_backgroundColour;
|
wxColour m_backgroundColour;
|
||||||
wxColour m_foregroundColour ;
|
wxColour m_foregroundColour;
|
||||||
wxRegion m_updateRegion;
|
wxRegion m_updateRegion;
|
||||||
long m_windowStyle;
|
long m_windowStyle;
|
||||||
bool m_isShown;
|
bool m_isShown;
|
||||||
@@ -330,6 +330,7 @@ public:
|
|||||||
bool m_resizing;
|
bool m_resizing;
|
||||||
GdkGC *m_scrollGC;
|
GdkGC *m_scrollGC;
|
||||||
GtkStyle *m_widgetStyle;
|
GtkStyle *m_widgetStyle;
|
||||||
|
bool m_isStaticBox;
|
||||||
|
|
||||||
wxInsertChildFunction m_insertCallback;
|
wxInsertChildFunction m_insertCallback;
|
||||||
|
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifndef __GTKSETTINGSH__
|
#ifndef __GTKSETTINGSH__
|
||||||
#define __GTKSETTINGSH__
|
#define __GTKSETTINGSH__
|
||||||
|
|
||||||
@@ -20,10 +19,10 @@
|
|||||||
#include "wx/pen.h"
|
#include "wx/pen.h"
|
||||||
#include "wx/font.h"
|
#include "wx/font.h"
|
||||||
|
|
||||||
class WXDLLEXPORT wxSystemSettings: public wxObject
|
class wxSystemSettings: public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline wxSystemSettings(void) {}
|
inline wxSystemSettings() {}
|
||||||
|
|
||||||
inline static void Init() {}
|
inline static void Init() {}
|
||||||
static void Done();
|
static void Done();
|
||||||
|
@@ -307,7 +307,7 @@ public:
|
|||||||
wxCursor *m_cursor;
|
wxCursor *m_cursor;
|
||||||
wxFont m_font;
|
wxFont m_font;
|
||||||
wxColour m_backgroundColour;
|
wxColour m_backgroundColour;
|
||||||
wxColour m_foregroundColour ;
|
wxColour m_foregroundColour;
|
||||||
wxRegion m_updateRegion;
|
wxRegion m_updateRegion;
|
||||||
long m_windowStyle;
|
long m_windowStyle;
|
||||||
bool m_isShown;
|
bool m_isShown;
|
||||||
@@ -330,6 +330,7 @@ public:
|
|||||||
bool m_resizing;
|
bool m_resizing;
|
||||||
GdkGC *m_scrollGC;
|
GdkGC *m_scrollGC;
|
||||||
GtkStyle *m_widgetStyle;
|
GtkStyle *m_widgetStyle;
|
||||||
|
bool m_isStaticBox;
|
||||||
|
|
||||||
wxInsertChildFunction m_insertCallback;
|
wxInsertChildFunction m_insertCallback;
|
||||||
|
|
||||||
|
@@ -270,7 +270,10 @@ void wxTextValidator::OnChar(wxKeyEvent& event)
|
|||||||
wxTextCtrl *textCtrl = (wxTextCtrl *)m_validatorWindow;
|
wxTextCtrl *textCtrl = (wxTextCtrl *)m_validatorWindow;
|
||||||
|
|
||||||
int keyCode = event.KeyCode();
|
int keyCode = event.KeyCode();
|
||||||
if ( keyCode == WXK_DELETE || keyCode == WXK_RETURN || keyCode == WXK_BACK)
|
if (keyCode == WXK_DELETE || keyCode == WXK_RETURN || keyCode == WXK_BACK ||
|
||||||
|
keyCode == WXK_HOME || keyCode == WXK_LEFT || keyCode == WXK_UP ||
|
||||||
|
keyCode == WXK_RIGHT || keyCode == WXK_DOWN || keyCode == WXK_PRIOR ||
|
||||||
|
keyCode == WXK_NEXT || keyCode == WXK_END || keyCode == WXK_HOME)
|
||||||
{
|
{
|
||||||
textCtrl->wxTextCtrl::OnChar(event);
|
textCtrl->wxTextCtrl::OnChar(event);
|
||||||
return ;
|
return ;
|
||||||
|
@@ -85,7 +85,7 @@ static wxString wxColourDialogNames[NUM_COLS]={"ORANGE",
|
|||||||
"FIREBRICK",
|
"FIREBRICK",
|
||||||
"CORAL",
|
"CORAL",
|
||||||
"FOREST GREEN",
|
"FOREST GREEN",
|
||||||
"AQUARAMINE",
|
"AQUAMARINE",
|
||||||
"BLUE",
|
"BLUE",
|
||||||
"NAVY",
|
"NAVY",
|
||||||
"THISTLE",
|
"THISTLE",
|
||||||
|
@@ -75,22 +75,12 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxPrintData* data):
|
|||||||
if ( data )
|
if ( data )
|
||||||
printData = *data;
|
printData = *data;
|
||||||
|
|
||||||
int buttonWidth = 65;
|
(void)new wxStaticBox( this, -1, _( "Printer options" ), wxPoint( 5, 5), wxSize( 300, 60 ) );
|
||||||
int buttonHeight = 25;
|
|
||||||
int spacing = 5;
|
|
||||||
int yPos = 5;
|
|
||||||
int xPos = 5;
|
|
||||||
|
|
||||||
wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(5, yPos), wxSize(buttonWidth, buttonHeight));
|
|
||||||
(void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(buttonWidth + 5 + spacing, yPos), wxSize(buttonWidth, buttonHeight));
|
|
||||||
|
|
||||||
setupButton = new wxButton(this, wxPRINTID_SETUP, _("Setup..."), wxPoint(buttonWidth*2 + 5 + 2*spacing, yPos), wxSize(buttonWidth, buttonHeight));
|
|
||||||
|
|
||||||
okButton->SetDefault();
|
|
||||||
okButton->SetFocus();
|
|
||||||
|
|
||||||
yPos += 35;
|
|
||||||
|
|
||||||
|
printToFileCheckBox = new wxCheckBox(this, wxPRINTID_PRINTTOFILE, _("Print to File"), wxPoint(20, 25) );
|
||||||
|
|
||||||
|
setupButton = new wxButton(this, wxPRINTID_SETUP, _("Setup..."), wxPoint(160, 25), wxSize(100, -1));
|
||||||
|
|
||||||
wxString *choices = new wxString[2];
|
wxString *choices = new wxString[2];
|
||||||
choices[0] = _("All");
|
choices[0] = _("All");
|
||||||
choices[1] = _("Pages");
|
choices[1] = _("Pages");
|
||||||
@@ -100,41 +90,30 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxPrintData* data):
|
|||||||
if(printData.GetFromPage() != 0)
|
if(printData.GetFromPage() != 0)
|
||||||
{
|
{
|
||||||
rangeRadioBox = new wxRadioBox(this, wxPRINTID_RANGE, _("Print Range"),
|
rangeRadioBox = new wxRadioBox(this, wxPRINTID_RANGE, _("Print Range"),
|
||||||
wxPoint(5, yPos), wxSize(-1, -1), 2, choices, 2);
|
wxPoint(5, 80), wxSize(-1, -1), 2, choices, 1, wxRA_VERTICAL);
|
||||||
rangeRadioBox->SetSelection(1);
|
rangeRadioBox->SetSelection(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
yPos += 60;
|
|
||||||
xPos = 5;
|
|
||||||
int staticWidth = 45;
|
|
||||||
int textWidth = 40;
|
|
||||||
spacing = 10;
|
|
||||||
|
|
||||||
if(printData.GetFromPage() != 0)
|
if(printData.GetFromPage() != 0)
|
||||||
{
|
{
|
||||||
(void) new wxStaticText(this, wxPRINTID_STATIC, _("From:"), wxPoint(xPos, yPos));
|
(void) new wxStaticText(this, wxPRINTID_STATIC, _("From:"), wxPoint(5, 135));
|
||||||
xPos += staticWidth;
|
|
||||||
|
|
||||||
fromText = new wxTextCtrl(this, wxPRINTID_FROM, "", wxPoint(xPos, yPos), wxSize(textWidth, -1));
|
fromText = new wxTextCtrl(this, wxPRINTID_FROM, "", wxPoint(45, 130), wxSize(40, -1));
|
||||||
xPos += spacing + textWidth;
|
|
||||||
|
|
||||||
(void) new wxStaticText(this, wxPRINTID_STATIC, _("To:"), wxPoint(xPos, yPos));
|
(void) new wxStaticText(this, wxPRINTID_STATIC, _("To:"), wxPoint(100, 135));
|
||||||
xPos += staticWidth;
|
|
||||||
|
|
||||||
toText = new wxTextCtrl(this, wxPRINTID_TO, "", wxPoint(xPos, yPos), wxSize(textWidth, -1));
|
toText = new wxTextCtrl(this, wxPRINTID_TO, "", wxPoint(133, 130), wxSize(40, -1));
|
||||||
xPos += spacing + textWidth;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) new wxStaticText(this, wxPRINTID_STATIC, _("Copies:"), wxPoint(xPos, yPos));
|
(void) new wxStaticText(this, wxPRINTID_STATIC, _("Copies:"), wxPoint(200, 135));
|
||||||
xPos += spacing + staticWidth;
|
|
||||||
|
|
||||||
noCopiesText = new wxTextCtrl(this, wxPRINTID_COPIES, "", wxPoint(xPos, yPos), wxSize(textWidth, -1));
|
noCopiesText = new wxTextCtrl(this, wxPRINTID_COPIES, "", wxPoint(252, 130), wxSize(40, -1));
|
||||||
|
|
||||||
yPos += 30;
|
wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(40, 180), wxSize(100, -1));
|
||||||
xPos = 5;
|
(void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(180, 180), wxSize(100, -1));
|
||||||
|
|
||||||
printToFileCheckBox = new wxCheckBox(this, wxPRINTID_PRINTTOFILE, _("Print to File"), wxPoint(xPos, yPos));
|
|
||||||
|
|
||||||
|
okButton->SetDefault();
|
||||||
|
okButton->SetFocus();
|
||||||
Fit();
|
Fit();
|
||||||
Centre(wxBOTH);
|
Centre(wxBOTH);
|
||||||
|
|
||||||
@@ -312,7 +291,7 @@ wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSe
|
|||||||
choices[1] = _("Landscape");
|
choices[1] = _("Landscape");
|
||||||
|
|
||||||
orientationRadioBox = new wxRadioBox(this, wxPRINTID_ORIENTATION, _("Orientation"),
|
orientationRadioBox = new wxRadioBox(this, wxPRINTID_ORIENTATION, _("Orientation"),
|
||||||
wxPoint(10, 80), wxSize(-1, -1), 2, choices, 2);
|
wxPoint(10, 80), wxSize(-1, -1), 2, choices, 1, wxRA_VERTICAL );
|
||||||
orientationRadioBox->SetSelection(0);
|
orientationRadioBox->SetSelection(0);
|
||||||
|
|
||||||
(void) new wxStaticBox(this, wxPRINTID_STATIC, _("Options"), wxPoint(10, 130), wxSize(200,50) );
|
(void) new wxStaticBox(this, wxPRINTID_STATIC, _("Options"), wxPoint(10, 130), wxSize(200,50) );
|
||||||
@@ -330,8 +309,8 @@ wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSe
|
|||||||
|
|
||||||
printerOptionsText = new wxTextCtrl(this, wxPRINTID_OPTIONS, "", wxPoint(260, 135), wxSize(150, -1));
|
printerOptionsText = new wxTextCtrl(this, wxPRINTID_OPTIONS, "", wxPoint(260, 135), wxSize(150, -1));
|
||||||
|
|
||||||
wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(240, 200), wxSize(100, -1));
|
wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(80, 200), wxSize(100, -1));
|
||||||
(void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(360, 200), wxSize(100, -1));
|
(void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(270, 200), wxSize(100, -1));
|
||||||
|
|
||||||
okButton->SetDefault();
|
okButton->SetDefault();
|
||||||
okButton->SetFocus();
|
okButton->SetFocus();
|
||||||
|
@@ -37,17 +37,17 @@ class wxColourRefData: public wxObjectRefData
|
|||||||
|
|
||||||
wxColourRefData::wxColourRefData()
|
wxColourRefData::wxColourRefData()
|
||||||
{
|
{
|
||||||
m_color.red = 0;
|
m_color.red = 0;
|
||||||
m_color.green = 0;
|
m_color.green = 0;
|
||||||
m_color.blue = 0;
|
m_color.blue = 0;
|
||||||
m_color.pixel = 0;
|
m_color.pixel = 0;
|
||||||
m_colormap = (GdkColormap *) NULL;
|
m_colormap = (GdkColormap *) NULL;
|
||||||
m_hasPixel = FALSE;
|
m_hasPixel = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColourRefData::~wxColourRefData()
|
wxColourRefData::~wxColourRefData()
|
||||||
{
|
{
|
||||||
FreeColour();
|
FreeColour();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColourRefData::FreeColour()
|
void wxColourRefData::FreeColour()
|
||||||
@@ -69,37 +69,39 @@ wxColour::wxColour()
|
|||||||
|
|
||||||
wxColour::wxColour( unsigned char red, unsigned char green, unsigned char blue )
|
wxColour::wxColour( unsigned char red, unsigned char green, unsigned char blue )
|
||||||
{
|
{
|
||||||
m_refData = new wxColourRefData();
|
m_refData = new wxColourRefData();
|
||||||
M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
|
M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
|
||||||
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
||||||
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
||||||
M_COLDATA->m_color.pixel = 0;
|
M_COLDATA->m_color.pixel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColour::InitFromName( const wxString &colourName )
|
void wxColour::InitFromName( const wxString &colourName )
|
||||||
{
|
{
|
||||||
wxNode *node = (wxNode *) NULL;
|
wxNode *node = (wxNode *) NULL;
|
||||||
if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
|
if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
|
||||||
{
|
|
||||||
wxColour *col = (wxColour*)node->Data();
|
|
||||||
UnRef();
|
|
||||||
if (col) Ref( *col );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_refData = new wxColourRefData();
|
|
||||||
if (!gdk_color_parse( colourName, &M_COLDATA->m_color ))
|
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( "wxColour: couldn't find colour" );
|
wxColour *col = (wxColour*)node->Data();
|
||||||
delete m_refData;
|
UnRef();
|
||||||
m_refData = (wxObjectRefData *) NULL;
|
if (col) Ref( *col );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_refData = new wxColourRefData();
|
||||||
|
if (!gdk_color_parse( colourName, &M_COLDATA->m_color ))
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( "wxColour: couldn't find colour" );
|
||||||
|
printf( "Colourname %s.\n", WXSTRINGCAST colourName );
|
||||||
|
|
||||||
|
delete m_refData;
|
||||||
|
m_refData = (wxObjectRefData *) NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour::wxColour( const wxColour& col )
|
wxColour::wxColour( const wxColour& col )
|
||||||
{
|
{
|
||||||
Ref( col );
|
Ref( col );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour::~wxColour()
|
wxColour::~wxColour()
|
||||||
@@ -108,75 +110,63 @@ wxColour::~wxColour()
|
|||||||
|
|
||||||
wxColour& wxColour::operator = ( const wxColour& col )
|
wxColour& wxColour::operator = ( const wxColour& col )
|
||||||
{
|
{
|
||||||
if (*this == col) return (*this);
|
if (*this == col) return (*this);
|
||||||
Ref( col );
|
Ref( col );
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxColour::operator == ( const wxColour& col )
|
bool wxColour::operator == ( const wxColour& col )
|
||||||
{
|
{
|
||||||
return m_refData == col.m_refData;
|
return m_refData == col.m_refData;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxColour::operator != ( const wxColour& col)
|
bool wxColour::operator != ( const wxColour& col)
|
||||||
{
|
{
|
||||||
return m_refData != col.m_refData;
|
return m_refData != col.m_refData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue )
|
void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue )
|
||||||
{
|
{
|
||||||
UnRef();
|
UnRef();
|
||||||
m_refData = new wxColourRefData();
|
m_refData = new wxColourRefData();
|
||||||
M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
|
M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
|
||||||
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
||||||
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
||||||
M_COLDATA->m_color.pixel = 0;
|
M_COLDATA->m_color.pixel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char wxColour::Red() const
|
unsigned char wxColour::Red() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid colour" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid colour" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
|
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char wxColour::Green() const
|
unsigned char wxColour::Green() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid colour" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid colour" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
|
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char wxColour::Blue() const
|
unsigned char wxColour::Blue() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid colour" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid colour" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
|
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxColour::Ok() const
|
bool wxColour::Ok() const
|
||||||
{
|
{
|
||||||
return (m_refData != NULL);
|
return (m_refData != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColour::CalcPixel( GdkColormap *cmap )
|
void wxColour::CalcPixel( GdkColormap *cmap )
|
||||||
{
|
{
|
||||||
if (!Ok()) return;
|
if (!Ok()) return;
|
||||||
|
|
||||||
if ((M_COLDATA->m_hasPixel) && (M_COLDATA->m_colormap == cmap)) return;
|
if ((M_COLDATA->m_hasPixel) && (M_COLDATA->m_colormap == cmap)) return;
|
||||||
M_COLDATA->FreeColour();
|
M_COLDATA->FreeColour();
|
||||||
|
|
||||||
GdkColormapPrivate *private_colormap = (GdkColormapPrivate*) cmap;
|
GdkColormapPrivate *private_colormap = (GdkColormapPrivate*) cmap;
|
||||||
if ((private_colormap->visual->type == GDK_VISUAL_GRAYSCALE) ||
|
if ((private_colormap->visual->type == GDK_VISUAL_GRAYSCALE) ||
|
||||||
@@ -198,26 +188,26 @@ void wxColour::CalcPixel( GdkColormap *cmap )
|
|||||||
M_COLDATA->m_hasPixel = TRUE;
|
M_COLDATA->m_hasPixel = TRUE;
|
||||||
M_COLDATA->m_color.pixel = index;
|
M_COLDATA->m_color.pixel = index;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
M_COLDATA->m_hasPixel = gdk_color_alloc( cmap, &M_COLDATA->m_color );
|
M_COLDATA->m_hasPixel = gdk_color_alloc( cmap, &M_COLDATA->m_color );
|
||||||
}
|
}
|
||||||
|
|
||||||
M_COLDATA->m_colormap = cmap;
|
M_COLDATA->m_colormap = cmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxColour::GetPixel() const
|
int wxColour::GetPixel() const
|
||||||
{
|
{
|
||||||
if (!Ok()) return 0;
|
wxCHECK_MSG( Ok(), 0, "invalid colour" );
|
||||||
|
|
||||||
return M_COLDATA->m_color.pixel;
|
return M_COLDATA->m_color.pixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkColor *wxColour::GetColor() const
|
GdkColor *wxColour::GetColor() const
|
||||||
{
|
{
|
||||||
if (!Ok()) return (GdkColor *) NULL;
|
wxCHECK_MSG( Ok(), (GdkColor *) NULL, "invalid colour" );
|
||||||
|
|
||||||
return &M_COLDATA->m_color;
|
return &M_COLDATA->m_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -179,22 +179,14 @@ bool wxFont::Ok() const
|
|||||||
|
|
||||||
int wxFont::GetPointSize() const
|
int wxFont::GetPointSize() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_pointSize;
|
return M_FONTDATA->m_pointSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxFont::GetFaceString() const
|
wxString wxFont::GetFaceString() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), "", "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
|
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
|
||||||
return s;
|
return s;
|
||||||
@@ -202,11 +194,7 @@ wxString wxFont::GetFaceString() const
|
|||||||
|
|
||||||
wxString wxFont::GetFaceName() const
|
wxString wxFont::GetFaceName() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), "", "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
|
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
|
||||||
return s;
|
return s;
|
||||||
@@ -214,22 +202,14 @@ wxString wxFont::GetFaceName() const
|
|||||||
|
|
||||||
int wxFont::GetFamily() const
|
int wxFont::GetFamily() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_family;
|
return M_FONTDATA->m_family;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxFont::GetFamilyString() const
|
wxString wxFont::GetFamilyString() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return "wxDEFAULT";
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (M_FONTDATA->m_family)
|
switch (M_FONTDATA->m_family)
|
||||||
{
|
{
|
||||||
@@ -247,33 +227,21 @@ wxString wxFont::GetFamilyString() const
|
|||||||
|
|
||||||
int wxFont::GetFontId() const
|
int wxFont::GetFontId() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_fontId; // stub
|
return M_FONTDATA->m_fontId; // stub
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxFont::GetStyle() const
|
int wxFont::GetStyle() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_style;
|
return M_FONTDATA->m_style;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxFont::GetStyleString() const
|
wxString wxFont::GetStyleString() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return "wxDEFAULT";
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (M_FONTDATA->m_style)
|
switch (M_FONTDATA->m_style)
|
||||||
{
|
{
|
||||||
@@ -288,22 +256,14 @@ wxString wxFont::GetStyleString() const
|
|||||||
|
|
||||||
int wxFont::GetWeight() const
|
int wxFont::GetWeight() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_weight;
|
return M_FONTDATA->m_weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxFont::GetWeightString() const
|
wxString wxFont::GetWeightString() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return "wxDEFAULT";
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (M_FONTDATA->m_weight)
|
switch (M_FONTDATA->m_weight)
|
||||||
{
|
{
|
||||||
@@ -318,11 +278,7 @@ wxString wxFont::GetWeightString() const
|
|||||||
|
|
||||||
bool wxFont::GetUnderlined() const
|
bool wxFont::GetUnderlined() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), FALSE, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_underlined;
|
return M_FONTDATA->m_underlined;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *WXUNUSED(widget),
|
|||||||
wxScrollBar *win )
|
wxScrollBar *win )
|
||||||
{
|
{
|
||||||
win->m_isScrolling = TRUE;
|
win->m_isScrolling = TRUE;
|
||||||
g_blockEventsOnScroll = TRUE;
|
// g_blockEventsOnScroll = TRUE; doesn't work in DialogEd
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -94,7 +94,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
|
|||||||
wxScrollBar *win )
|
wxScrollBar *win )
|
||||||
{
|
{
|
||||||
win->m_isScrolling = FALSE;
|
win->m_isScrolling = FALSE;
|
||||||
g_blockEventsOnScroll = FALSE;
|
// g_blockEventsOnScroll = FALSE;
|
||||||
|
|
||||||
gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" );
|
gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" );
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
|
#include "wx/debug.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#define wxSYS_COLOUR_SCROLLBAR 0
|
#define wxSYS_COLOUR_SCROLLBAR 0
|
||||||
@@ -59,12 +60,13 @@ wxColour *g_systemHighlightColour = (wxColour *) NULL;
|
|||||||
|
|
||||||
wxFont *g_systemFont = (wxFont *) NULL;
|
wxFont *g_systemFont = (wxFont *) NULL;
|
||||||
|
|
||||||
void wxSystemSettings::Done() {
|
void wxSystemSettings::Done()
|
||||||
wxDELETE(g_systemBtnFaceColour);
|
{
|
||||||
wxDELETE(g_systemBtnShadowColour);
|
wxDELETE(g_systemBtnFaceColour);
|
||||||
wxDELETE(g_systemBtnHighlightColour);
|
wxDELETE(g_systemBtnShadowColour);
|
||||||
wxDELETE(g_systemHighlightColour);
|
wxDELETE(g_systemBtnHighlightColour);
|
||||||
wxDELETE(g_systemFont);
|
wxDELETE(g_systemHighlightColour);
|
||||||
|
wxDELETE(g_systemFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour wxSystemSettings::GetSystemColour( int index )
|
wxColour wxSystemSettings::GetSystemColour( int index )
|
||||||
@@ -176,12 +178,15 @@ wxFont wxSystemSettings::GetSystemFont( int index )
|
|||||||
|
|
||||||
int wxSystemSettings::GetSystemMetric( int index )
|
int wxSystemSettings::GetSystemMetric( int index )
|
||||||
{
|
{
|
||||||
switch (index)
|
switch (index)
|
||||||
{
|
{
|
||||||
case wxSYS_SCREEN_X:
|
case wxSYS_SCREEN_X: return gdk_screen_width();
|
||||||
return gdk_screen_width();
|
case wxSYS_SCREEN_Y: return gdk_screen_height();
|
||||||
case wxSYS_SCREEN_Y:
|
case wxSYS_HSCROLL_Y: return 15;
|
||||||
return gdk_screen_height();
|
case wxSYS_VSCROLL_X: return 15;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
wxCHECK_MSG( index, 0, "wxSystemSettings::GetSystemMetric not fully implemented" );
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -27,45 +27,47 @@ wxStaticBox::wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label
|
|||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint &pos, const wxSize &size,
|
||||||
long style, const wxString &name )
|
long style, const wxString &name )
|
||||||
{
|
{
|
||||||
Create( parent, id, label, pos, size, style, name );
|
Create( parent, id, label, pos, size, style, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint &pos, const wxSize &size,
|
||||||
long style, const wxString &name )
|
long style, const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
|
|
||||||
PreCreation( parent, id, pos, size, style, name );
|
PreCreation( parent, id, pos, size, style, name );
|
||||||
|
|
||||||
m_widget = gtk_frame_new(m_label);
|
m_isStaticBox = TRUE;
|
||||||
|
|
||||||
|
m_widget = gtk_frame_new(m_label);
|
||||||
|
|
||||||
m_parent->AddChild( this );
|
m_parent->AddChild( this );
|
||||||
|
|
||||||
(m_parent->m_insertCallback)( m_parent, this );
|
(m_parent->m_insertCallback)( m_parent, this );
|
||||||
|
|
||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
SetLabel(label);
|
SetLabel(label);
|
||||||
|
|
||||||
SetBackgroundColour( parent->GetBackgroundColour() );
|
SetBackgroundColour( parent->GetBackgroundColour() );
|
||||||
SetForegroundColour( parent->GetForegroundColour() );
|
SetForegroundColour( parent->GetForegroundColour() );
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBox::SetLabel( const wxString &label )
|
void wxStaticBox::SetLabel( const wxString &label )
|
||||||
{
|
{
|
||||||
wxControl::SetLabel( label );
|
wxControl::SetLabel( label );
|
||||||
GtkFrame *frame = GTK_FRAME( m_widget );
|
GtkFrame *frame = GTK_FRAME( m_widget );
|
||||||
gtk_frame_set_label( frame, GetLabel() );
|
gtk_frame_set_label( frame, GetLabel() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBox::ApplyWidgetStyle()
|
void wxStaticBox::ApplyWidgetStyle()
|
||||||
{
|
{
|
||||||
SetWidgetStyle();
|
SetWidgetStyle();
|
||||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1192
src/gtk/window.cpp
1192
src/gtk/window.cpp
File diff suppressed because it is too large
Load Diff
@@ -37,17 +37,17 @@ class wxColourRefData: public wxObjectRefData
|
|||||||
|
|
||||||
wxColourRefData::wxColourRefData()
|
wxColourRefData::wxColourRefData()
|
||||||
{
|
{
|
||||||
m_color.red = 0;
|
m_color.red = 0;
|
||||||
m_color.green = 0;
|
m_color.green = 0;
|
||||||
m_color.blue = 0;
|
m_color.blue = 0;
|
||||||
m_color.pixel = 0;
|
m_color.pixel = 0;
|
||||||
m_colormap = (GdkColormap *) NULL;
|
m_colormap = (GdkColormap *) NULL;
|
||||||
m_hasPixel = FALSE;
|
m_hasPixel = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColourRefData::~wxColourRefData()
|
wxColourRefData::~wxColourRefData()
|
||||||
{
|
{
|
||||||
FreeColour();
|
FreeColour();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColourRefData::FreeColour()
|
void wxColourRefData::FreeColour()
|
||||||
@@ -69,37 +69,39 @@ wxColour::wxColour()
|
|||||||
|
|
||||||
wxColour::wxColour( unsigned char red, unsigned char green, unsigned char blue )
|
wxColour::wxColour( unsigned char red, unsigned char green, unsigned char blue )
|
||||||
{
|
{
|
||||||
m_refData = new wxColourRefData();
|
m_refData = new wxColourRefData();
|
||||||
M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
|
M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
|
||||||
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
||||||
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
||||||
M_COLDATA->m_color.pixel = 0;
|
M_COLDATA->m_color.pixel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColour::InitFromName( const wxString &colourName )
|
void wxColour::InitFromName( const wxString &colourName )
|
||||||
{
|
{
|
||||||
wxNode *node = (wxNode *) NULL;
|
wxNode *node = (wxNode *) NULL;
|
||||||
if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
|
if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
|
||||||
{
|
|
||||||
wxColour *col = (wxColour*)node->Data();
|
|
||||||
UnRef();
|
|
||||||
if (col) Ref( *col );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_refData = new wxColourRefData();
|
|
||||||
if (!gdk_color_parse( colourName, &M_COLDATA->m_color ))
|
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( "wxColour: couldn't find colour" );
|
wxColour *col = (wxColour*)node->Data();
|
||||||
delete m_refData;
|
UnRef();
|
||||||
m_refData = (wxObjectRefData *) NULL;
|
if (col) Ref( *col );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_refData = new wxColourRefData();
|
||||||
|
if (!gdk_color_parse( colourName, &M_COLDATA->m_color ))
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( "wxColour: couldn't find colour" );
|
||||||
|
printf( "Colourname %s.\n", WXSTRINGCAST colourName );
|
||||||
|
|
||||||
|
delete m_refData;
|
||||||
|
m_refData = (wxObjectRefData *) NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour::wxColour( const wxColour& col )
|
wxColour::wxColour( const wxColour& col )
|
||||||
{
|
{
|
||||||
Ref( col );
|
Ref( col );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour::~wxColour()
|
wxColour::~wxColour()
|
||||||
@@ -108,75 +110,63 @@ wxColour::~wxColour()
|
|||||||
|
|
||||||
wxColour& wxColour::operator = ( const wxColour& col )
|
wxColour& wxColour::operator = ( const wxColour& col )
|
||||||
{
|
{
|
||||||
if (*this == col) return (*this);
|
if (*this == col) return (*this);
|
||||||
Ref( col );
|
Ref( col );
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxColour::operator == ( const wxColour& col )
|
bool wxColour::operator == ( const wxColour& col )
|
||||||
{
|
{
|
||||||
return m_refData == col.m_refData;
|
return m_refData == col.m_refData;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxColour::operator != ( const wxColour& col)
|
bool wxColour::operator != ( const wxColour& col)
|
||||||
{
|
{
|
||||||
return m_refData != col.m_refData;
|
return m_refData != col.m_refData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue )
|
void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue )
|
||||||
{
|
{
|
||||||
UnRef();
|
UnRef();
|
||||||
m_refData = new wxColourRefData();
|
m_refData = new wxColourRefData();
|
||||||
M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
|
M_COLDATA->m_color.red = ((unsigned short)red) << SHIFT;
|
||||||
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
|
||||||
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
|
||||||
M_COLDATA->m_color.pixel = 0;
|
M_COLDATA->m_color.pixel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char wxColour::Red() const
|
unsigned char wxColour::Red() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid colour" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid colour" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
|
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char wxColour::Green() const
|
unsigned char wxColour::Green() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid colour" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid colour" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
|
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char wxColour::Blue() const
|
unsigned char wxColour::Blue() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid colour" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid colour" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
|
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxColour::Ok() const
|
bool wxColour::Ok() const
|
||||||
{
|
{
|
||||||
return (m_refData != NULL);
|
return (m_refData != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColour::CalcPixel( GdkColormap *cmap )
|
void wxColour::CalcPixel( GdkColormap *cmap )
|
||||||
{
|
{
|
||||||
if (!Ok()) return;
|
if (!Ok()) return;
|
||||||
|
|
||||||
if ((M_COLDATA->m_hasPixel) && (M_COLDATA->m_colormap == cmap)) return;
|
if ((M_COLDATA->m_hasPixel) && (M_COLDATA->m_colormap == cmap)) return;
|
||||||
M_COLDATA->FreeColour();
|
M_COLDATA->FreeColour();
|
||||||
|
|
||||||
GdkColormapPrivate *private_colormap = (GdkColormapPrivate*) cmap;
|
GdkColormapPrivate *private_colormap = (GdkColormapPrivate*) cmap;
|
||||||
if ((private_colormap->visual->type == GDK_VISUAL_GRAYSCALE) ||
|
if ((private_colormap->visual->type == GDK_VISUAL_GRAYSCALE) ||
|
||||||
@@ -198,26 +188,26 @@ void wxColour::CalcPixel( GdkColormap *cmap )
|
|||||||
M_COLDATA->m_hasPixel = TRUE;
|
M_COLDATA->m_hasPixel = TRUE;
|
||||||
M_COLDATA->m_color.pixel = index;
|
M_COLDATA->m_color.pixel = index;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
M_COLDATA->m_hasPixel = gdk_color_alloc( cmap, &M_COLDATA->m_color );
|
M_COLDATA->m_hasPixel = gdk_color_alloc( cmap, &M_COLDATA->m_color );
|
||||||
}
|
}
|
||||||
|
|
||||||
M_COLDATA->m_colormap = cmap;
|
M_COLDATA->m_colormap = cmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxColour::GetPixel() const
|
int wxColour::GetPixel() const
|
||||||
{
|
{
|
||||||
if (!Ok()) return 0;
|
wxCHECK_MSG( Ok(), 0, "invalid colour" );
|
||||||
|
|
||||||
return M_COLDATA->m_color.pixel;
|
return M_COLDATA->m_color.pixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkColor *wxColour::GetColor() const
|
GdkColor *wxColour::GetColor() const
|
||||||
{
|
{
|
||||||
if (!Ok()) return (GdkColor *) NULL;
|
wxCHECK_MSG( Ok(), (GdkColor *) NULL, "invalid colour" );
|
||||||
|
|
||||||
return &M_COLDATA->m_color;
|
return &M_COLDATA->m_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -179,22 +179,14 @@ bool wxFont::Ok() const
|
|||||||
|
|
||||||
int wxFont::GetPointSize() const
|
int wxFont::GetPointSize() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_pointSize;
|
return M_FONTDATA->m_pointSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxFont::GetFaceString() const
|
wxString wxFont::GetFaceString() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), "", "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
|
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
|
||||||
return s;
|
return s;
|
||||||
@@ -202,11 +194,7 @@ wxString wxFont::GetFaceString() const
|
|||||||
|
|
||||||
wxString wxFont::GetFaceName() const
|
wxString wxFont::GetFaceName() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), "", "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
|
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
|
||||||
return s;
|
return s;
|
||||||
@@ -214,22 +202,14 @@ wxString wxFont::GetFaceName() const
|
|||||||
|
|
||||||
int wxFont::GetFamily() const
|
int wxFont::GetFamily() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_family;
|
return M_FONTDATA->m_family;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxFont::GetFamilyString() const
|
wxString wxFont::GetFamilyString() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return "wxDEFAULT";
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (M_FONTDATA->m_family)
|
switch (M_FONTDATA->m_family)
|
||||||
{
|
{
|
||||||
@@ -247,33 +227,21 @@ wxString wxFont::GetFamilyString() const
|
|||||||
|
|
||||||
int wxFont::GetFontId() const
|
int wxFont::GetFontId() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_fontId; // stub
|
return M_FONTDATA->m_fontId; // stub
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxFont::GetStyle() const
|
int wxFont::GetStyle() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_style;
|
return M_FONTDATA->m_style;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxFont::GetStyleString() const
|
wxString wxFont::GetStyleString() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return "wxDEFAULT";
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (M_FONTDATA->m_style)
|
switch (M_FONTDATA->m_style)
|
||||||
{
|
{
|
||||||
@@ -288,22 +256,14 @@ wxString wxFont::GetStyleString() const
|
|||||||
|
|
||||||
int wxFont::GetWeight() const
|
int wxFont::GetWeight() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), 0, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_weight;
|
return M_FONTDATA->m_weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxFont::GetWeightString() const
|
wxString wxFont::GetWeightString() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return "wxDEFAULT";
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (M_FONTDATA->m_weight)
|
switch (M_FONTDATA->m_weight)
|
||||||
{
|
{
|
||||||
@@ -318,11 +278,7 @@ wxString wxFont::GetWeightString() const
|
|||||||
|
|
||||||
bool wxFont::GetUnderlined() const
|
bool wxFont::GetUnderlined() const
|
||||||
{
|
{
|
||||||
if (!Ok())
|
wxCHECK_MSG( Ok(), FALSE, "invalid font" );
|
||||||
{
|
|
||||||
wxFAIL_MSG( "invalid font" );
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return M_FONTDATA->m_underlined;
|
return M_FONTDATA->m_underlined;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *WXUNUSED(widget),
|
|||||||
wxScrollBar *win )
|
wxScrollBar *win )
|
||||||
{
|
{
|
||||||
win->m_isScrolling = TRUE;
|
win->m_isScrolling = TRUE;
|
||||||
g_blockEventsOnScroll = TRUE;
|
// g_blockEventsOnScroll = TRUE; doesn't work in DialogEd
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -94,7 +94,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
|
|||||||
wxScrollBar *win )
|
wxScrollBar *win )
|
||||||
{
|
{
|
||||||
win->m_isScrolling = FALSE;
|
win->m_isScrolling = FALSE;
|
||||||
g_blockEventsOnScroll = FALSE;
|
// g_blockEventsOnScroll = FALSE;
|
||||||
|
|
||||||
gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" );
|
gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" );
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
|
#include "wx/debug.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#define wxSYS_COLOUR_SCROLLBAR 0
|
#define wxSYS_COLOUR_SCROLLBAR 0
|
||||||
@@ -59,12 +60,13 @@ wxColour *g_systemHighlightColour = (wxColour *) NULL;
|
|||||||
|
|
||||||
wxFont *g_systemFont = (wxFont *) NULL;
|
wxFont *g_systemFont = (wxFont *) NULL;
|
||||||
|
|
||||||
void wxSystemSettings::Done() {
|
void wxSystemSettings::Done()
|
||||||
wxDELETE(g_systemBtnFaceColour);
|
{
|
||||||
wxDELETE(g_systemBtnShadowColour);
|
wxDELETE(g_systemBtnFaceColour);
|
||||||
wxDELETE(g_systemBtnHighlightColour);
|
wxDELETE(g_systemBtnShadowColour);
|
||||||
wxDELETE(g_systemHighlightColour);
|
wxDELETE(g_systemBtnHighlightColour);
|
||||||
wxDELETE(g_systemFont);
|
wxDELETE(g_systemHighlightColour);
|
||||||
|
wxDELETE(g_systemFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour wxSystemSettings::GetSystemColour( int index )
|
wxColour wxSystemSettings::GetSystemColour( int index )
|
||||||
@@ -176,12 +178,15 @@ wxFont wxSystemSettings::GetSystemFont( int index )
|
|||||||
|
|
||||||
int wxSystemSettings::GetSystemMetric( int index )
|
int wxSystemSettings::GetSystemMetric( int index )
|
||||||
{
|
{
|
||||||
switch (index)
|
switch (index)
|
||||||
{
|
{
|
||||||
case wxSYS_SCREEN_X:
|
case wxSYS_SCREEN_X: return gdk_screen_width();
|
||||||
return gdk_screen_width();
|
case wxSYS_SCREEN_Y: return gdk_screen_height();
|
||||||
case wxSYS_SCREEN_Y:
|
case wxSYS_HSCROLL_Y: return 15;
|
||||||
return gdk_screen_height();
|
case wxSYS_VSCROLL_X: return 15;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
wxCHECK_MSG( index, 0, "wxSystemSettings::GetSystemMetric not fully implemented" );
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -27,45 +27,47 @@ wxStaticBox::wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label
|
|||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint &pos, const wxSize &size,
|
||||||
long style, const wxString &name )
|
long style, const wxString &name )
|
||||||
{
|
{
|
||||||
Create( parent, id, label, pos, size, style, name );
|
Create( parent, id, label, pos, size, style, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint &pos, const wxSize &size,
|
||||||
long style, const wxString &name )
|
long style, const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
|
|
||||||
PreCreation( parent, id, pos, size, style, name );
|
PreCreation( parent, id, pos, size, style, name );
|
||||||
|
|
||||||
m_widget = gtk_frame_new(m_label);
|
m_isStaticBox = TRUE;
|
||||||
|
|
||||||
|
m_widget = gtk_frame_new(m_label);
|
||||||
|
|
||||||
m_parent->AddChild( this );
|
m_parent->AddChild( this );
|
||||||
|
|
||||||
(m_parent->m_insertCallback)( m_parent, this );
|
(m_parent->m_insertCallback)( m_parent, this );
|
||||||
|
|
||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
SetLabel(label);
|
SetLabel(label);
|
||||||
|
|
||||||
SetBackgroundColour( parent->GetBackgroundColour() );
|
SetBackgroundColour( parent->GetBackgroundColour() );
|
||||||
SetForegroundColour( parent->GetForegroundColour() );
|
SetForegroundColour( parent->GetForegroundColour() );
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBox::SetLabel( const wxString &label )
|
void wxStaticBox::SetLabel( const wxString &label )
|
||||||
{
|
{
|
||||||
wxControl::SetLabel( label );
|
wxControl::SetLabel( label );
|
||||||
GtkFrame *frame = GTK_FRAME( m_widget );
|
GtkFrame *frame = GTK_FRAME( m_widget );
|
||||||
gtk_frame_set_label( frame, GetLabel() );
|
gtk_frame_set_label( frame, GetLabel() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBox::ApplyWidgetStyle()
|
void wxStaticBox::ApplyWidgetStyle()
|
||||||
{
|
{
|
||||||
SetWidgetStyle();
|
SetWidgetStyle();
|
||||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1192
src/gtk1/window.cpp
1192
src/gtk1/window.cpp
File diff suppressed because it is too large
Load Diff
@@ -313,7 +313,7 @@ bool wxResourceManager::ShowResourceEditor(bool show, wxWindow *WXUNUSED(parent)
|
|||||||
c->bottom.SameAs (m_editorFrame, wxBottom, 0);
|
c->bottom.SameAs (m_editorFrame, wxBottom, 0);
|
||||||
c->width.Unconstrained();
|
c->width.Unconstrained();
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
c->height.Absolute(140);
|
c->height.Absolute(105);
|
||||||
#else
|
#else
|
||||||
c->height.Absolute(60);
|
c->height.Absolute(60);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user