home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
yacl-012.zip
/
uidemo
/
textedit
/
appwin.cxx
next >
Wrap
C/C++ Source or Header
|
1995-04-08
|
955b
|
38 lines
#include "ui/applic.h"
#include "ui/stddlg.h"
#include "appwin.h"
#include <fstream.h>
#define ID_BUTTON 101
AppWindow::AppWindow ()
: UI_CompositeVObject (NULL, (UI_ViewDescriptor*) NULL, FALSE,
UI_Rectangle (50, 50, 310, 250))
{
_btn = new UI_PushButton (this, UI_Rectangle (120, 210, 60, 30),
ID_BUTTON);
_edit = new UI_TextEditor (this, UI_Rectangle ( 5, 5, 300, 200));
_btn->Title () = "Save";
(CL_String&) _edit->Model() = "What you type here will be saved"
" in junk.dat";
}
bool AppWindow::HandleChildEvent (const UI_Event& e)
{
if (e.Type() != Event_Select || e.Origin() != _btn)
return FALSE;
CL_String msg = "Selection: " + _edit->Selection().AsString();
UI_SimpleDialog (msg);
ofstream f ("junk.dat");
f << (_edit->Model());
_Application->Destroy (this);
return TRUE;
}