void StringDialog::Init (const char* msg, const char* confirmLbl, int width) { int space = Math::round(fspace*ivcm); _sedit = new StringEditor(state, ""); HBox* framedSedit = new HBox; if (width == 0) { framedSedit->Insert(_sedit); } else { framedSedit->Insert(new HGlue); framedSedit->Insert( new VBox( new Frame(new MarginFrame(_sedit, 2)), new HGlue(width, 0, 0) ) ); framedSedit->Insert(new HGlue); } Insert( new MarginFrame( new VBox( new Message(msg), new VGlue(space), framedSedit, new VGlue(space), new HBox( new HGlue, new PushButton(" Cancel ", state, '\007'), new HGlue(space, 0), new PushButton(confirmLbl, state, '\r') ) ), space, space, 0 ) ); }
Interactor* MoveDialog::Interior () { const int space = iv26_round(.5*cm); VBox* titleblock = new VBox( new HBox(_title, new HGlue), new HBox(_subtitle, new HGlue) ); HBox* rbuttons = new HBox( new RadioButton("Pixels", _units, 'p'), new HGlue(space, 0), new RadioButton("Points", _units, 'o'), new HGlue(space, 0), new RadioButton("Centimeters", _units, 'c'), new HGlue(space, 0), new RadioButton("Inches", _units, 'i') ); rbuttons->Insert(new HGlue); return new MarginFrame( new VBox( titleblock, new VGlue(space), new Frame(new MarginFrame(_medit, 2)), new VGlue(space/2, 0), rbuttons, new VGlue(space), new HBox( new HGlue, new PushButton("Cancel", state, '\007'), new HGlue(space, 0), new PushButton(" OK ", state, '\r') ) ), space, space/2, 0 ); }
void Idraw::Init () { input = new Sensor; input->Catch(KeyEvent); drawing = new Drawing(8.5*inches, 11*inches); drawingview = new DrawingView(drawing->GetPage()); editor = new Editor(this); errhandler = new ErrHandler; mapkey = new MapKey; state = new State(this); tools = new Tools(editor, mapkey); drawingview->SetDrawHandler(this); drawingview->SetEventHandler(tools); drawingview->SetGrid(drawing->GetGrid()); drawingview->SetPageBoundary(drawing->GetPageBoundary()); drawingview->SetSelectionList(drawing->GetSelectionList()); drawingview->SetState(state); editor->SetDrawing(drawing); editor->SetDrawingView(drawingview); editor->SetGrid(drawing->GetGrid()); editor->SetState(state); errhandler->SetEditor(editor); errhandler->Install(); HBox* us = new HBox; us->Insert(new ModifStatusView(state)); us->Insert(new DrawingNameView(state)); us->Insert(new GriddingView(state)); us->Insert(new FontView(state)); us->Insert(new MagnifView(state, drawingview)); HBox* ls_c = new HBox; ls_c->Insert(new BrushView(state)); ls_c->Insert(new VBorder); ls_c->Insert(new PatternView(state)); ls_c->Insert(new VBorder); ls_c->Insert(new Commands(editor, mapkey, state)); ls_c->Insert(new HGlue); VBox* us_ls_c = new VBox; us_ls_c->Insert(us); us_ls_c->Insert(new HBorder); us_ls_c->Insert(ls_c); VBox* t_p = new VBox; t_p->Insert(tools); t_p->Insert(new VGlue); t_p->Insert(new HBorder); t_p->Insert(new Panner(drawingview)); t_p->Propagate(false); HBox* t_p_d = new HBox; t_p_d->Insert(t_p); t_p_d->Insert(new VBorder); t_p_d->Insert(drawingview); VBox* us_ls_c_t_p_d = new VBox; us_ls_c_t_p_d->Insert(us_ls_c); us_ls_c_t_p_d->Insert(new HBorder); us_ls_c_t_p_d->Insert(t_p_d); Insert(new Frame(us_ls_c_t_p_d, 1)); }