/*
wxDynamicSashWindow. See above.
*/
+extern const wxChar* GIZMODLLEXPORT wxDynamicSashWindowNameStr;
+
class GIZMODLLEXPORT wxDynamicSashWindow : public wxWindow {
public:
wxDynamicSashWindow();
wxDynamicSashWindow(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER,
- const wxString& name = "dynamicSashWindow");
+ const wxString& name = wxDynamicSashWindowNameStr);
virtual ~wxDynamicSashWindow();
virtual bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER,
- const wxString& name = "dynamicSashWindow");
+ const wxString& name = wxDynamicSashWindowNameStr);
virtual wxScrollBar *GetHScrollBar(const wxWindow *child) const;
virtual wxScrollBar *GetVScrollBar(const wxWindow *child) const;
virtual int GetRegionId(const wxString& name);
// Construct names for regions, unique even for children of a composite.
- virtual void NameRegions(const wxString& parentName = "");
+ virtual void NameRegions(const wxString& parentName = wxEmptyString);
// Get list of regions
inline wxList& GetRegions() const { return (wxList&) m_regions; }
{
DECLARE_DYNAMIC_CLASS(wxShapeTextLine)
public:
- wxShapeTextLine(double the_x = 0.0, double the_y = 0.0, const wxString& the_line = "");
+ wxShapeTextLine(double the_x = 0.0, double the_y = 0.0, const wxString& the_line = wxEmptyString);
~wxShapeTextLine();
inline double GetX() const { return m_x; }
{
DECLARE_DYNAMIC_CLASS(wxOGLConstraintType)
public:
- wxOGLConstraintType(int type = 0, const wxString& name = "", const wxString& phrase = "");
+ wxOGLConstraintType(int type = 0, const wxString& name = wxEmptyString,
+ const wxString& phrase = wxEmptyString);
~wxOGLConstraintType();
public:
{
DECLARE_DYNAMIC_CLASS(wxOGLConstraint)
public:
- wxOGLConstraint() { m_xSpacing = 0.0; m_ySpacing = 0.0; m_constraintType = 0; m_constraintName = ""; m_constraintId = 0;
- m_constrainingObject = NULL; }
+ wxOGLConstraint() {
+ m_xSpacing = 0.0; m_ySpacing = 0.0; m_constraintType = 0;
+ m_constraintName = wxEmptyString; m_constraintId = 0;
+ m_constrainingObject = NULL; }
wxOGLConstraint(int type, wxShape *constraining, wxList& constrained);
~wxOGLConstraint();
// Rotate about the given axis by theta radians from the x axis.
void Rotate(double x, double y, double theta);
- bool LoadFromMetaFile(char *filename, double *width, double *height);
+ bool LoadFromMetaFile(const wxString& filename, double *width, double *height);
void GetBounds(double *minX, double *minY, double *maxX, double *maxY);
inline double GetRotation() const { return m_rotation; }
void SetSize(double w, double h, bool recursive = TRUE);
- bool LoadFromMetaFile(char *filename);
+ bool LoadFromMetaFile(const wxString& filename);
inline void SetSaveToFile(bool save) { m_saveToFile = save; }
inline wxPseudoMetaFile& GetMetaFile(int which = 0) const { return (wxPseudoMetaFile&) m_metafiles[which]; }
DECLARE_DYNAMIC_CLASS(wxArrowHead)
public:
- wxArrowHead(WXTYPE type = 0, int end = 0, double size = 0.0, double dist = 0.0, const wxString& name = "", wxPseudoMetaFile *mf = NULL,
+ wxArrowHead(WXTYPE type = 0, int end = 0, double size = 0.0, double dist = 0.0, const wxString& name = wxEmptyString, wxPseudoMetaFile *mf = NULL,
long arrowId = -1);
~wxArrowHead();
wxArrowHead(wxArrowHead& toCopy);
// Add an arrowhead.
wxArrowHead *AddArrow(WXTYPE type, int end = ARROW_POSITION_END,
- double arrowSize = 10.0, double xOffset = 0.0, const wxString& name = "",
- wxPseudoMetaFile *mf = NULL, long arrowId = -1);
+ double arrowSize = 10.0, double xOffset = 0.0,
+ const wxString& name = wxEmptyString,
+ wxPseudoMetaFile *mf = NULL, long arrowId = -1);
// Add an arrowhead in the position indicated by the reference
// list of arrowheads, which contains all legal arrowheads for this
wxList metaRecords;
wxList gdiObjects; // List of wxMetaRecord objects created with Create...,
// referenced by position in list by SelectObject
- wxXMetaFile(char *file = NULL);
+ wxXMetaFile(const wxChar* file = NULL);
~wxXMetaFile(void);
// After this is called, the metafile cannot be used for anything
bool Play(wxDC *dc);
inline bool Ok(void) const { return ok; }
- bool ReadFile(char *file);
+ bool ReadFile(const wxChar *file);
};
#endif
#include "wx/gizmos/dynamicsash.h"
+
+const wxChar* wxDynamicSashWindowNameStr = wxT("dynamicSashWindow");
+
+
/*
wxDynamicSashWindow works by internally storing a tree of Implementation
objects (wxDynamicSsahWindowImpl) and Leaf objects
m_brush = wxWHITE_BRUSH;
m_font = g_oglNormalFont;
m_textColour = wxBLACK;
- m_textColourName = "BLACK";
+ m_textColourName = wxT("BLACK");
m_visible = FALSE;
m_selected = FALSE;
m_attachmentMode = ATTACHMENT_MODE_NONE;
m_shadowBrush = wxBLACK_BRUSH;
m_textMarginX = 5;
m_textMarginY = 5;
- m_regionName = "0";
+ m_regionName = wxT("0");
m_centreResize = TRUE;
m_maintainAspectRatio = FALSE;
m_highlighted = FALSE;
// the region eventually (the duplication is for compatibility)
wxShapeRegion *region = new wxShapeRegion;
m_regions.Append(region);
- region->SetName("0");
+ region->SetName(wxT("0"));
region->SetFont(g_oglNormalFont);
region->SetFormatMode(FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT);
- region->SetColour("BLACK");
+ region->SetColour(wxT("BLACK"));
}
wxShape::~wxShape()
node = stringList->First();
while (node)
{
- char *s = (char *)node->Data();
+ wxChar *s = (wxChar *)node->Data();
wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s);
region->GetFormattedText().Append((wxObject *)line);
node = node->Next();
{
wxNode *node = m_regions.Nth(regionId);
if (!node)
- return wxString("");
+ return wxEmptyString;
wxShapeRegion *region = (wxShapeRegion *)node->Data();
return region->GetColour();
}
{
wxNode *node = m_regions.Nth(regionId);
if (!node)
- return wxString("");
+ return wxEmptyString;
wxShapeRegion *region = (wxShapeRegion *)node->Data();
return region->GetName();
}
for (int i = 0; i < n; i++)
{
if (parentName.Length() > 0)
- buff << parentName << "." << i;
+ buff << parentName << wxT(".") << i;
else
buff << i;
SetRegionName(buff, i);
buff.Empty();
wxShape *child = (wxShape *)node->Data();
if (parentName.Length() > 0)
- buff << parentName << "." << j;
+ buff << parentName << wxT(".") << j;
else
buff << j;
child->NameRegions(buff);
wxShapeRegion::wxShapeRegion()
{
- m_regionText = "";
+ m_regionText = wxEmptyString;
m_font = g_oglNormalFont;
m_minHeight = 5.0;
m_minWidth = 5.0;
m_regionProportionX = -1.0;
m_regionProportionY = -1.0;
m_formatMode = FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT;
- m_regionName = "";
- m_textColour = "BLACK";
- m_penColour = "BLACK";
+ m_regionName = wxEmptyString;
+ m_textColour = wxT("BLACK");
+ m_penColour = wxT("BLACK");
m_penStyle = wxSOLID;
m_actualColourObject = NULL;
m_actualPenObject = NULL;
return m_actualPenObject;
if (!m_penColour) return NULL;
- if (m_penColour == "Invisible")
+ if (m_penColour == wxT("Invisible"))
return NULL;
m_actualPenObject = wxThePenList->FindOrCreatePen(m_penColour, 1, m_penStyle);
return m_actualPenObject;
wxBitmapShape::wxBitmapShape():wxRectangleShape(100.0, 50.0)
{
- m_filename = "";
+ m_filename = wxEmptyString;
}
wxBitmapShape::~wxBitmapShape()
m_handleSide = DIVISION_SIDE_NONE;
m_leftSidePen = wxBLACK_PEN;
m_topSidePen = wxBLACK_PEN;
- m_leftSideColour = "BLACK";
- m_topSideColour = "BLACK";
- m_leftSideStyle = "Solid";
- m_topSideStyle = "Solid";
+ m_leftSideColour = wxT("BLACK");
+ m_topSideColour = wxT("BLACK");
+ m_leftSideStyle = wxT("Solid");
+ m_topSideStyle = wxT("Solid");
ClearRegions();
}
class OGLPopupDivisionMenu : public wxMenu {
public:
OGLPopupDivisionMenu() : wxMenu() {
- Append(DIVISION_MENU_SPLIT_HORIZONTALLY, "Split horizontally");
- Append(DIVISION_MENU_SPLIT_VERTICALLY, "Split vertically");
+ Append(DIVISION_MENU_SPLIT_HORIZONTALLY, wxT("Split horizontally"));
+ Append(DIVISION_MENU_SPLIT_VERTICALLY, wxT("Split vertically"));
AppendSeparator();
- Append(DIVISION_MENU_EDIT_LEFT_EDGE, "Edit left edge");
- Append(DIVISION_MENU_EDIT_TOP_EDGE, "Edit top edge");
+ Append(DIVISION_MENU_EDIT_LEFT_EDGE, wxT("Edit left edge"));
+ Append(DIVISION_MENU_EDIT_TOP_EDGE, wxT("Edit top edge"));
}
void OnMenu(wxCommandEvent& event);
void wxDivisionShape::EditEdge(int side)
{
- wxMessageBox("EditEdge() not implemented", "OGL", wxOK);
+ wxMessageBox(wxT("EditEdge() not implemented"), wxT("OGL"), wxOK);
#if 0
wxBeginBusyCursor();
wxOGLConstraintTypes = new wxList(wxKEY_INTEGER);
wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_VERTICALLY,
- new wxOGLConstraintType(gyCONSTRAINT_CENTRED_VERTICALLY, "Centre vertically", "centred vertically w.r.t."));
+ new wxOGLConstraintType(gyCONSTRAINT_CENTRED_VERTICALLY, wxT("Centre vertically"), wxT("centred vertically w.r.t.")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_HORIZONTALLY,
- new wxOGLConstraintType(gyCONSTRAINT_CENTRED_HORIZONTALLY, "Centre horizontally", "centred horizontally w.r.t."));
+ new wxOGLConstraintType(gyCONSTRAINT_CENTRED_HORIZONTALLY, wxT("Centre horizontally"), wxT("centred horizontally w.r.t.")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_BOTH,
- new wxOGLConstraintType(gyCONSTRAINT_CENTRED_BOTH, "Centre", "centred w.r.t."));
+ new wxOGLConstraintType(gyCONSTRAINT_CENTRED_BOTH, wxT("Centre"), wxT("centred w.r.t.")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_LEFT_OF,
- new wxOGLConstraintType(gyCONSTRAINT_LEFT_OF, "Left of", "left of"));
+ new wxOGLConstraintType(gyCONSTRAINT_LEFT_OF, wxT("Left of"), wxT("left of")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_RIGHT_OF,
- new wxOGLConstraintType(gyCONSTRAINT_RIGHT_OF, "Right of", "right of"));
+ new wxOGLConstraintType(gyCONSTRAINT_RIGHT_OF, wxT("Right of"), wxT("right of")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_ABOVE,
- new wxOGLConstraintType(gyCONSTRAINT_ABOVE, "Above", "above"));
+ new wxOGLConstraintType(gyCONSTRAINT_ABOVE, wxT("Above"), wxT("above")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_BELOW,
- new wxOGLConstraintType(gyCONSTRAINT_BELOW, "Below", "below"));
+ new wxOGLConstraintType(gyCONSTRAINT_BELOW, wxT("Below"), wxT("below")));
// Alignment
wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_TOP,
- new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_TOP, "Top-aligned", "aligned to the top of"));
+ new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_TOP, wxT("Top-aligned"), wxT("aligned to the top of")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_BOTTOM,
- new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_BOTTOM, "Bottom-aligned", "aligned to the bottom of"));
+ new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_BOTTOM, wxT("Bottom-aligned"), wxT("aligned to the bottom of")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_LEFT,
- new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_LEFT, "Left-aligned", "aligned to the left of"));
+ new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_LEFT, wxT("Left-aligned"), wxT("aligned to the left of")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_RIGHT,
- new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_RIGHT, "Right-aligned", "aligned to the right of"));
+ new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_RIGHT, wxT("Right-aligned"), wxT("aligned to the right of")));
// Mid-alignment
wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_TOP,
- new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_TOP, "Top-midaligned", "centred on the top of"));
+ new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_TOP, wxT("Top-midaligned"), wxT("centred on the top of")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_BOTTOM,
- new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_BOTTOM, "Bottom-midaligned", "centred on the bottom of"));
+ new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_BOTTOM, wxT("Bottom-midaligned"), wxT("centred on the bottom of")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_LEFT,
- new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_LEFT, "Left-midaligned", "centred on the left of"));
+ new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_LEFT, wxT("Left-midaligned"), wxT("centred on the left of")));
wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_RIGHT,
- new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_RIGHT, "Right-midaligned", "centred on the right of"));
+ new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_RIGHT, wxT("Right-midaligned"), wxT("centred on the right of")));
}
void OGLCleanUpConstraintTypes()
m_constrainingObject = constraining;
m_constraintId = 0;
- m_constraintName = "noname";
+ m_constraintName = wxT("noname");
wxNode *node = constrained.First();
while (node)
void wxDividedShape::EditRegions()
{
- wxMessageBox("EditRegions() is unimplemented.", "OGL", wxOK);
+ wxMessageBox(wxT("EditRegions() is unimplemented."), wxT("OGL"), wxOK);
// TODO
#if 0
drawnCopy.m_currentAngle = m_currentAngle;
}
-bool wxDrawnShape::LoadFromMetaFile(char *filename)
+bool wxDrawnShape::LoadFromMetaFile(const wxString& filename)
{
return m_metafiles[0].LoadFromMetaFile(filename, &m_width, &m_height);
}
*
*/
-bool wxPseudoMetaFile::LoadFromMetaFile(char *filename, double *rwidth, double *rheight)
+bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth, double *rheight)
{
if (!wxFileExists(filename))
return NULL;
// and make the three line regions.
ClearRegions();
wxShapeRegion *newRegion = new wxShapeRegion;
- newRegion->SetName("Middle");
+ newRegion->SetName(wxT("Middle"));
newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion);
newRegion = new wxShapeRegion;
- newRegion->SetName("Start");
+ newRegion->SetName(wxT("Start"));
newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion);
newRegion = new wxShapeRegion;
- newRegion->SetName("End");
+ newRegion->SetName(wxT("End"));
newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion);
node = string_list->First();
while (node)
{
- char *s = (char *)node->Data();
+ wxChar *s = (wxChar *)node->Data();
wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s);
region->GetFormattedText().Append((wxObject *)line);
node = node->Next();
if (stringParam) delete[] stringParam;
}
-wxXMetaFile::wxXMetaFile(char *file)
+wxXMetaFile::wxXMetaFile(const wxChar *file)
{
ok = FALSE;
top = 0.0;
return (HandleTableSize - 1);
}
-bool wxXMetaFile::ReadFile(char *file)
+bool wxXMetaFile::ReadFile(const wxChar *file)
{
HandleTableSize = 0;
- FILE *handle = fopen(file, "rb");
+ FILE *handle = wxFopen(file, wxT("rb"));
if (!handle) return FALSE;
// Read placeable metafile header, if any
{
wxString oldBuffer(buffer);
- char *s = (char *)node->Data();
+ wxChar *s = (wxChar *)node->Data();
if (!s)
{
// FORCE NEW LINE
else
{
if (buffer.Length() != 0)
- buffer += " ";
+ buffer += wxT(" ");
buffer += s;
dc.GetTextExtent(buffer, &x, &y);
wxNode *node = list->First();
while (node)
{
- char *s = (char *)node->Data();
+ wxChar *s = (wxChar *)node->Data();
item->Append(s);
node = node->Next();
}