Skip to content

Commit

Permalink
use wxString instead of dstr
Browse files Browse the repository at this point in the history
  • Loading branch information
afb committed Jan 28, 2007
1 parent a85ed6c commit 44b338b
Show file tree
Hide file tree
Showing 110 changed files with 931 additions and 866 deletions.
8 changes: 4 additions & 4 deletions wx/App.d
Expand Up @@ -45,10 +45,10 @@ private import std.utf;
static extern (C) void wxApp_Run(int argc, char** argv);

static extern (C) void wxApp_SetVendorName(IntPtr self, string name);
static extern (C) string wxApp_GetVendorName(IntPtr self);
static extern (C) IntPtr wxApp_GetVendorName(IntPtr self);

static extern (C) void wxApp_SetAppName(IntPtr self, string name);
static extern (C) string wxApp_GetAppName(IntPtr self);
static extern (C) IntPtr wxApp_GetAppName(IntPtr self);

static extern (C) void wxApp_SetTopWindow(IntPtr self, IntPtr window);
static extern (C) IntPtr wxApp_GetTopWindow(IntPtr self);
Expand Down Expand Up @@ -171,8 +171,8 @@ private import std.utf;

//---------------------------------------------------------------------

public string VendorName() { return wxApp_GetVendorName(wxobj).dup; }
public string AppName() { return wxApp_GetAppName(wxobj).dup; }
public string VendorName() { return cast(string) new wxString(wxApp_GetVendorName(wxobj), true); }
public string AppName() { return cast(string) new wxString(wxApp_GetAppName(wxobj), true); }

//---------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions wx/ArrayString.d
Expand Up @@ -7,7 +7,7 @@ public import wx.common;
static extern (C) void wxArrayString_dtor(IntPtr self);
static extern (C) void wxArrayString_RegisterDisposable(IntPtr self, Virtual_Dispose onDispose);
static extern (C) void wxArrayString_Add(IntPtr self, string toadd);
static extern (C) string wxArrayString_Item(IntPtr self, int num);
static extern (C) IntPtr wxArrayString_Item(IntPtr self, int num);
static extern (C) int wxArrayString_GetCount(IntPtr self);
//! \endcond

Expand Down Expand Up @@ -46,7 +46,7 @@ public import wx.common;

public string Item(int num)
{
return wxArrayString_Item(wxobj, num).dup;
return cast(string) new wxString(wxArrayString_Item(wxobj, num), true);
}

public void Add(string toadd)
Expand Down
6 changes: 3 additions & 3 deletions wx/BitmapButton.d
Expand Up @@ -31,7 +31,7 @@ public import wx.Control;
static extern (C) void wxBitmapButton_SetDefault(IntPtr self);

static extern (C) void wxBitmapButton_SetLabel(IntPtr self, string label);
static extern (C) string wxBitmapButton_GetLabel(IntPtr self);
static extern (C) IntPtr wxBitmapButton_GetLabel(IntPtr self);

static extern (C) bool wxBitmapButton_Enable(IntPtr self, bool enable);

Expand Down Expand Up @@ -132,7 +132,7 @@ public import wx.Control;

//---------------------------------------------------------------------

public string StringLabel() { return wxBitmapButton_GetLabel(wxobj).dup; }
public string StringLabel() { return cast(string) new wxString(wxBitmapButton_GetLabel(wxobj), true); }
public void StringLabel(string value) { wxBitmapButton_SetLabel(wxobj, value); }

public void SetLabel(string label)
Expand All @@ -142,7 +142,7 @@ public import wx.Control;

public string GetLabel()
{
return wxBitmapButton_GetLabel(wxobj).dup;
return cast(string) new wxString(wxBitmapButton_GetLabel(wxobj), true);
}

//---------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions wx/Choice.d
Expand Up @@ -27,14 +27,14 @@ public import wx.ArrayString;

static extern (C) void wxChoice_SetSelection(IntPtr self, int n);
static extern (C) bool wxChoice_SetStringSelection(IntPtr self, string s);
static extern (C) string wxChoice_GetStringSelection(IntPtr self);
static extern (C) IntPtr wxChoice_GetStringSelection(IntPtr self);

static extern (C) void wxChoice_SetColumns(IntPtr self, int n);
static extern (C) int wxChoice_GetColumns(IntPtr self);

static extern (C) void wxChoice_Command(IntPtr self, IntPtr evt);
static extern (C) int wxChoice_GetCount(IntPtr self);
static extern (C) string wxChoice_GetString(IntPtr self, int n);
static extern (C) IntPtr wxChoice_GetString(IntPtr self, int n);
static extern (C) int wxChoice_GetSelection(IntPtr self);

static extern (C) IntPtr wxChoice_GetClientData(IntPtr self, int n);
Expand Down Expand Up @@ -195,7 +195,7 @@ public import wx.ArrayString;

//---------------------------------------------------------------------

public string StringSelection() { return wxChoice_GetStringSelection(wxobj).dup; }
public string StringSelection() { return cast(string) new wxString(wxChoice_GetStringSelection(wxobj), true); }
public void StringSelection(string value) { wxChoice_SetStringSelection(wxobj, value); }

//---------------------------------------------------------------------
Expand All @@ -218,7 +218,7 @@ public import wx.ArrayString;

public string GetString(int n)
{
return wxChoice_GetString(wxobj, n).dup;
return cast(string) new wxString(wxChoice_GetString(wxobj, n), true);
}

//---------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions wx/ChoiceDialog.d
Expand Up @@ -23,7 +23,7 @@ public import wx.ArrayInt;
static extern (C) IntPtr wxSingleChoiceDialog_ctor(IntPtr parent, string message, string caption, int n, string* choices, IntPtr clientData, uint style, inout Point pos);
static extern (C) void wxSingleChoiceDialog_SetSelection(IntPtr self, int sel);
static extern (C) int wxSingleChoiceDialog_GetSelection(IntPtr self);
static extern (C) string wxSingleChoiceDialog_GetStringSelection(IntPtr self);
static extern (C) IntPtr wxSingleChoiceDialog_GetStringSelection(IntPtr self);
static extern (C) IntPtr wxSingleChoiceDialog_GetSelectionClientData(IntPtr self);
//! \endcond

Expand Down Expand Up @@ -65,7 +65,7 @@ public import wx.ArrayInt;

public string StringSelection()
{
return wxSingleChoiceDialog_GetStringSelection(wxobj).dup;
return cast(string) new wxString(wxSingleChoiceDialog_GetStringSelection(wxobj), true);
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -114,15 +114,15 @@ public import wx.ArrayInt;
//-----------------------------------------------------------------------------

//! \cond EXTERN
static extern (C) string wxGetSingleChoice_func(string message, string caption, int n, string* choices, IntPtr parent, int x, int y, bool centre, int width, int height);
static extern (C) IntPtr wxGetSingleChoice_func(string message, string caption, int n, string* choices, IntPtr parent, int x, int y, bool centre, int width, int height);
static extern (C) int wxGetSingleChoiceIndex_func(string message, string caption, int n, string* choices, IntPtr parent, int x, int y, bool centre, int width, int height);
static extern (C) void* wxGetSingleChoiceData_func(string message, string caption, int n, string* choices, void **client_data, IntPtr parent, int x, int y, bool centre, int width, int height);
static extern (C) uint wxGetMultipleChoices_func(IntPtr selections,string message, string caption, int n, string* choices, IntPtr parent, int x, int y, bool centre, int width, int height);
//! \endcond

public string GetSingleChoice(string message, string caption, string[] choices, Window parent = null, int x = -1, int y= -1, bool centre = true, int width = SingleChoiceDialog.wxCHOICE_WIDTH, int height = SingleChoiceDialog.wxCHOICE_HEIGHT)
{
return wxGetSingleChoice_func(message, caption, choices.length, choices.ptr, wxObject.SafePtr(parent), x, y, centre, width, height).dup;
return cast(string) new wxString(wxGetSingleChoice_func(message, caption, choices.length, choices.ptr, wxObject.SafePtr(parent), x, y, centre, width, height), true);
}

public int GetSingleChoiceIndex(string message, string caption, string[] choices, Window parent = null, int x = -1, int y= -1, bool centre = true, int width = SingleChoiceDialog.wxCHOICE_WIDTH, int height = SingleChoiceDialog.wxCHOICE_HEIGHT)
Expand Down
4 changes: 2 additions & 2 deletions wx/ClientData.d
Expand Up @@ -57,7 +57,7 @@ public import wx.common;
static extern (C) IntPtr wxStringClientData_ctor(string data);
static extern (C) void wxStringClientData_dtor(IntPtr self);
static extern (C) void wxStringClientData_SetData(IntPtr self, string data);
static extern (C) string wxStringClientData_GetData(IntPtr self);
static extern (C) IntPtr wxStringClientData_GetData(IntPtr self);
//! \endcond

//---------------------------------------------------------------------
Expand Down Expand Up @@ -87,7 +87,7 @@ public import wx.common;
override protected void dtor() { wxStringClientData_dtor(wxobj); }
//---------------------------------------------------------------------

public string Data() { return wxStringClientData_GetData(wxobj).dup; }
public string Data() { return cast(string) new wxString(wxStringClientData_GetData(wxobj), true); }
public void Data(string value) { wxStringClientData_SetData(wxobj, value); }
}

12 changes: 6 additions & 6 deletions wx/ComboBox.d
Expand Up @@ -33,13 +33,13 @@ public import wx.ClientData;

static extern (C) int wxComboBox_GetCount(IntPtr self);
static extern (C) int wxComboBox_GetSelection(IntPtr self);
static extern (C) string wxComboBox_GetString(IntPtr self, int n);
static extern (C) IntPtr wxComboBox_GetString(IntPtr self, int n);
//static extern (C) void wxComboBox_SetString(IntPtr self, int n, string text);

static extern (C) string wxComboBox_GetValue(IntPtr self);
static extern (C) IntPtr wxComboBox_GetValue(IntPtr self);
static extern (C) void wxComboBox_SetValue(IntPtr self, string text);

static extern (C) string wxComboBox_GetStringSelection(IntPtr self);
static extern (C) IntPtr wxComboBox_GetStringSelection(IntPtr self);
static extern (C) void wxComboBox_SetStringSelection(IntPtr self, string value);

static extern (C) IntPtr wxComboBox_GetClientData(IntPtr self, int n);
Expand Down Expand Up @@ -125,7 +125,7 @@ public import wx.ClientData;

//---------------------------------------------------------------------

public string StringSelection() { return wxComboBox_GetStringSelection(wxobj).dup; }
public string StringSelection() { return cast(string) new wxString(wxComboBox_GetStringSelection(wxobj), true); }
public void StringSelection(string value) { wxComboBox_SetStringSelection(wxobj, value); }

//---------------------------------------------------------------------
Expand All @@ -136,7 +136,7 @@ public import wx.ClientData;

public string GetString(int n)
{
return wxComboBox_GetString(wxobj, n).dup;
return cast(string) new wxString(wxComboBox_GetString(wxobj, n), true);
}

//---------------------------------------------------------------------
Expand Down Expand Up @@ -254,7 +254,7 @@ public import wx.ClientData;

//---------------------------------------------------------------------

public string Value() { return wxComboBox_GetValue(wxobj).dup; }
public string Value() { return cast(string) new wxString(wxComboBox_GetValue(wxobj), true); }
public void Value(string value) { wxComboBox_SetValue(wxobj, value); }

public void Select(int n)
Expand Down
4 changes: 2 additions & 2 deletions wx/CommandEvent.d
Expand Up @@ -22,7 +22,7 @@ public import wx.ClientData;
//! \cond EXTERN
static extern (C) IntPtr wxCommandEvent_ctor(int type,int winid);
static extern (C) int wxCommandEvent_GetSelection(IntPtr self);
static extern (C) string wxCommandEvent_GetString(IntPtr self);
static extern (C) IntPtr wxCommandEvent_GetString(IntPtr self);
static extern (C) void wxCommandEvent_SetString(IntPtr self, string s);
static extern (C) bool wxCommandEvent_IsChecked(IntPtr self);
static extern (C) bool wxCommandEvent_IsSelection(IntPtr self);
Expand Down Expand Up @@ -54,7 +54,7 @@ public import wx.ClientData;

//-----------------------------------------------------------------------------

public string String() { return wxCommandEvent_GetString(wxobj).dup; }
public string String() { return cast(string) new wxString(wxCommandEvent_GetString(wxobj), true); }
public void String(string value) { wxCommandEvent_SetString(wxobj, value); }

//-----------------------------------------------------------------------------
Expand Down
20 changes: 10 additions & 10 deletions wx/Config.d
Expand Up @@ -44,7 +44,7 @@ public import wx.wxString;
static extern (C) IntPtr wxConfigBase_Create();
static extern (C) void wxConfigBase_DontCreateOnDemand();
static extern (C) void wxConfigBase_SetPath(IntPtr self, string strPath);
static extern (C) string wxConfigBase_GetPath(IntPtr self);
static extern (C) IntPtr wxConfigBase_GetPath(IntPtr self);
static extern (C) bool wxConfigBase_GetFirstGroup(IntPtr self, IntPtr str, inout int lIndex);
static extern (C) bool wxConfigBase_GetNextGroup(IntPtr self, IntPtr str, inout int lIndex);
static extern (C) bool wxConfigBase_GetFirstEntry(IntPtr self, IntPtr str, inout int lIndex);
Expand All @@ -63,7 +63,7 @@ public import wx.wxString;
static extern (C) bool wxConfigBase_ReadDblDef(IntPtr self, string key, inout double val, double defVal);
static extern (C) bool wxConfigBase_ReadBool(IntPtr self, string key, inout bool val);
static extern (C) bool wxConfigBase_ReadBoolDef(IntPtr self, string key, inout bool val, bool defVal);
static extern (C) string wxConfigBase_ReadStrRet(IntPtr self, string key, string defVal);
static extern (C) IntPtr wxConfigBase_ReadStrRet(IntPtr self, string key, string defVal);
static extern (C) int wxConfigBase_ReadIntRet(IntPtr self, string key, int defVal);
static extern (C) bool wxConfigBase_WriteStr(IntPtr self, string key, string val);
static extern (C) bool wxConfigBase_WriteInt(IntPtr self, string key, int val);
Expand All @@ -77,12 +77,12 @@ public import wx.wxString;
static extern (C) bool wxConfigBase_DeleteAll(IntPtr self);
static extern (C) bool wxConfigBase_IsExpandingEnvVars(IntPtr self);
static extern (C) void wxConfigBase_SetExpandEnvVars(IntPtr self, bool bDoIt);
static extern (C) string wxConfigBase_ExpandEnvVars(IntPtr self, string str);
static extern (C) IntPtr wxConfigBase_ExpandEnvVars(IntPtr self, string str);
static extern (C) void wxConfigBase_SetRecordDefaults(IntPtr self, bool bDoIt);
static extern (C) bool wxConfigBase_IsRecordingDefaults(IntPtr self);
static extern (C) string wxConfigBase_GetAppName(IntPtr self);
static extern (C) IntPtr wxConfigBase_GetAppName(IntPtr self);
static extern (C) void wxConfigBase_SetAppName(IntPtr self, string appName);
static extern (C) string wxConfigBase_GetVendorName(IntPtr self);
static extern (C) IntPtr wxConfigBase_GetVendorName(IntPtr self);
static extern (C) void wxConfigBase_SetVendorName(IntPtr self, string vendorName);
static extern (C) void wxConfigBase_SetStyle(IntPtr self, int style);
static extern (C) int wxConfigBase_GetStyle(IntPtr self);
Expand Down Expand Up @@ -130,7 +130,7 @@ public import wx.wxString;
//---------------------------------------------------------------------

public void Path(string value) { wxConfigBase_SetPath(wxobj, value); }
public string Path() { return wxConfigBase_GetPath(wxobj).dup; }
public string Path() { return cast(string) new wxString(wxConfigBase_GetPath(wxobj), true); }

//---------------------------------------------------------------------

Expand Down Expand Up @@ -365,7 +365,7 @@ public import wx.wxString;
/+
public string Read(string key, string defVal)
{
return wxConfigBase_ReadStrRet(wxobj, key, defVal).dup;
return cast(string) new wxString(wxConfigBase_ReadStrRet(wxobj, key, defVal), true);
}
+/
public int Read(string key, int defVal)
Expand Down Expand Up @@ -497,7 +497,7 @@ public import wx.wxString;

/*public string ExpandEnvVars(string str)
{
return new wxString(wxConfigBase_ExpandEnvVars(wxobj, str));
return cast(string) new wxString(wxConfigBase_ExpandEnvVars(wxobj, str));
}*/

//---------------------------------------------------------------------
Expand All @@ -507,12 +507,12 @@ public import wx.wxString;

//---------------------------------------------------------------------

public string AppName() { return wxConfigBase_GetAppName(wxobj).dup; }
public string AppName() { return cast(string) new wxString(wxConfigBase_GetAppName(wxobj), true); }
public void AppName(string value) { wxConfigBase_SetAppName(wxobj, value); }

//---------------------------------------------------------------------

public string VendorName() { return wxConfigBase_GetVendorName(wxobj).dup; }
public string VendorName() { return cast(string) new wxString(wxConfigBase_GetVendorName(wxobj), true); }
public void VendorName(string value) { wxConfigBase_SetVendorName(wxobj, value); }

//---------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions wx/Control.d
Expand Up @@ -19,7 +19,7 @@ public import wx.Window;

//! \cond EXTERN
static extern (C) void wxControl_Command(IntPtr self, IntPtr evt);
static extern (C) string wxControl_GetLabel(IntPtr self);
static extern (C) IntPtr wxControl_GetLabel(IntPtr self);
static extern (C) void wxControl_SetLabel(IntPtr self, string label);

static extern (C) int wxControl_GetAlignment(IntPtr self);
Expand Down Expand Up @@ -51,7 +51,7 @@ public import wx.Window;

//---------------------------------------------------------------------

public string Label() { return wxControl_GetLabel(wxobj).dup; }
public string Label() { return cast(string) new wxString(wxControl_GetLabel(wxobj), true); }
public void Label(string value) { wxControl_SetLabel(wxobj, value); }

//---------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions wx/DataFormat.d
Expand Up @@ -44,7 +44,7 @@ public import wx.common;
static extern (C) IntPtr wxDataFormat_ctorByType(int type);
static extern (C) IntPtr wxDataFormat_ctorById(string id);

static extern (C) string wxDataFormat_GetId(IntPtr self);
static extern (C) IntPtr wxDataFormat_GetId(IntPtr self);
static extern (C) void wxDataFormat_SetId(IntPtr self, string id);

static extern (C) int wxDataFormat_GetType(IntPtr self);
Expand Down Expand Up @@ -82,7 +82,7 @@ public import wx.common;

//-----------------------------------------------------------------------------

public string Id() { return wxDataFormat_GetId(wxobj); }
public string Id() { return cast(string) new wxString(wxDataFormat_GetId(wxobj), true); }
public void Id(string value) { wxDataFormat_SetId(wxobj, value); }

//-----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions wx/DataObject.d
Expand Up @@ -83,7 +83,7 @@ public import wx.ArrayString;
static extern (C) void wxTextDataObject_dtor(IntPtr self);
static extern (C) void wxTextDataObject_RegisterDisposable(IntPtr self, Virtual_Dispose onDispose);
static extern (C) int wxTextDataObject_GetTextLength(IntPtr self);
static extern (C) string wxTextDataObject_GetText(IntPtr self);
static extern (C) IntPtr wxTextDataObject_GetText(IntPtr self);
static extern (C) void wxTextDataObject_SetText(IntPtr self, string text);
//! \endcond

Expand Down Expand Up @@ -122,7 +122,7 @@ public import wx.ArrayString;

//---------------------------------------------------------------------

public string Text() { return wxTextDataObject_GetText(wxobj).dup; }
public string Text() { return cast(string) new wxString(wxTextDataObject_GetText(wxobj), true); }
public void Text(string value) { wxTextDataObject_SetText(wxobj, value); }
}

Expand Down

0 comments on commit 44b338b

Please sign in to comment.