ubit
edi.hpp
1 /*************************************************************************
2  *
3  * edi.hpp: a simple text editor
4  * Ubit Demos - Version 6
5  * (C) 2009 Eric Lecolinet | TELECOM ParisTech | http://www.enst.fr/~elc/ubit
6  *
7  * ***********************************************************************
8  * COPYRIGHT NOTICE :
9  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE
10  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
11  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU
12  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION;
13  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
14  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
15  * ************************************************************************/
16 
17 #ifndef _edi_hpp_
18 #define _edi_hpp_ 1
19 #include <ubit/ubit.hpp>
20 using namespace ubit;
21 
22 class Edi : public UBox {
23 public:
24  Edi();
25  void openFile(const UStr& path);
26  void openCloneOnDisplay(const UStr& display_name);
27  void quit();
28 
29 private:
30  friend struct ZoomAction;
31  UBox mainbox;
32  UStr path; // complete filename of the page
33  UFilebox openbox; // file box for selecting the page
34  UStr text; // edited text
35  UScale scale; // text scale
36  UFont font; // text font
37  UTextarea textarea; // widget that contains the text
38  UScrollpane spane; // scrollpane that contains the textarea widget
39  USpinbox spinbox; // controls the text scale
40  UCtlmenu cmenu; // contextual menu
41  UDialog* fontDialog();
42  void openFileCB(UStr* fpath);
43  void initCMenu();
44 };
45 
46 #endif
47 
Box container.
Definition: ubox.hpp:64
Textarea widget: multiple line editor.
Definition: uinteractors.hpp:199
Spinbox gadget.
Definition: uinteractors.hpp:397
Definition: edi.cpp:218
A box with (optionnal) scrollbars that manages a viewport.
Definition: uscrollpane.hpp:37
Font of a UElem or UBox container.
Definition: ufont.hpp:30
Definition: uhardfont.hpp:31
Dialog box.
Definition: udialogs.hpp:29
Definition: edi.hpp:22
Widget scale.
Definition: uboxgeom.hpp:31
Definition: ufilebox.hpp:49
Control menu.
Definition: uctlmenu.hpp:73
Ubit String.
Definition: ustr.hpp:72