[ create a new paste ] login | about

Link: http://codepad.org/Kc5TxXjU    [ raw code | fork ]

D, pasted on Nov 27:
import wx.wx;
import wx.Image;
import wx.Notebook;
import wx.TextCtrl;
import wx.StyledTextCtrl;

import std.string;

class MainAppFrame : wxFrame
{ 
public:
    this(Window parent, int id, string title, Point pos = wxDefaultPosition, Size size = wxDefaultSize, int style = wxDEFAULT_FRAME_STYLE)
    {
        super(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE);

        this.notebook_1 = new Notebook(this);
        this.notebook_1_pane_1 = new Panel(this.notebook_1, -1);
        this.styledCtrl = new StyledTextCtrl(this.notebook_1_pane_1, wxID_ANY, wxDefaultPosition, Size(-1, -1), Stretch.wxEXPAND);
        
        this.set_properties();
        this.do_layout();
    }
    
private:
    void set_properties()
    {
        this.Title("frame_1");
        this.SetSize(Size(500, 400));
    }

    void do_layout()
    {
        sizer_2 = new BoxSizer(Orientation.wxVERTICAL);
        sizer_3 = new BoxSizer(Orientation.wxVERTICAL);
        sizer_3.Add(this.styledCtrl, 1, Stretch.wxEXPAND, 0);
        this.notebook_1_pane_1.SetSizer(sizer_3);
        this.notebook_1.AddPage(this.notebook_1_pane_1, "tab1");
        sizer_2.Add(this.notebook_1, 1, Stretch.wxEXPAND, 0);
        this.SetSizer(sizer_2);
        sizer_2.Fit(this);  
        
        this.Layout();
    }

protected:
    Notebook notebook_1;
    Panel notebook_1_pane_1;
    Button button_1;
    
    BoxSizer sizer_2;
    BoxSizer sizer_3;
    
    StyledTextCtrl styledCtrl;
}

class MyApp : public wxApp
{
    bool OnInit()
    {
        MainAppFrame MainApp = new MainAppFrame(null, wxID_ANY, "");
        MainApp.Show();
        return true;
    }

    static void Main()
    {
        MyApp app = new MyApp();
        app.Run();
    }
}

int main()
{
    MyApp.Main();
    return 0;
}


Create a new paste based on this one


Comments: