Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

NDK_XX::PushButton Class Reference

#include <ndk++.h>

Inheritance diagram for NDK_XX::PushButton:

NDK_XX::Button NDK_XX::Label NDK_XX::Control NDK_XX::PropDlgPushButton List of all members.

Public Methods

 PushButton (Control *parent, int id, const string &title,int lines, int cols, int y, int x,int style=tabstop|notify|framed)
 PushButton (Control *parent, int id, const string &title,int y, int x)
void set_text (const string &txt)
 Usualy, a control in a dialog has some kind of text on it...

int action ()
 action fired when user presses Enter


Constructor & Destructor Documentation

NDK_XX::PushButton::PushButton Control   parent,
int    id,
const string &    title,
int    lines,
int    cols,
int    y,
int    x,
int    style = tabstop|notify|framed
 

PushButton Constructor See parameters for class Control

Definition at line 401 of file ndk++.cc.

References NDK_XX::Control::enable_notify(), NDK_XX::Control::framed, NDK_XX::Control::set_style(), set_text(), and NDK_XX::Label::text.

Referenced by NDK_XX::EditNumber::EditNumber().

00405         :Button(parent,id, title,lines,cols,y,x,(style&=~framed))
00406 {
00407     enable_notify(false);
00408     set_style(framed,true);
00409     set_text(text);
00410     enable_notify();
00411 }

NDK_XX::PushButton::PushButton Control   parent,
int    id,
const string &    title,
int    y,
int    x
 

PushButton Constructor See parameters for class Control

Definition at line 415 of file ndk++.cc.

References NDK_XX::Control::enable_notify(), NDK_XX::Control::framed, NDK_XX::Control::set_style(), set_text(), and NDK_XX::Label::text.

00418         :Button(parent,id,title,1,title.size()+3,y,x,tabstop|notify)
00419 {
00420     enable_notify(false);
00421     set_style(framed,true);
00422     set_text(text);
00423     enable_notify(); 
00424 }


Member Function Documentation

int NDK_XX::PushButton::action   [inline, virtual]
 

action fired when user presses Enter

Implements NDK_XX::Button.

Definition at line 725 of file ndk++.h.

References NDK_XX::ListItemData::is_checked(), and NDK_XX::ListItemData::set_state().

00725                                        {
00726         bool prev_state=is_checked();
00727         set_state((int)Control::checked,new_state);
00728     };

void NDK_XX::PushButton::set_text const string &    txt [virtual]
 

Usualy, a control in a dialog has some kind of text on it...

Reimplemented from NDK_XX::Label.

Definition at line 428 of file ndk++.cc.

References NDK_XX::Control::has_frame(), NDK_XX::Label::max_len(), NDK_XX::Label::pos_x, and NDK_XX::Label::text.

Referenced by NDK_XX::PropertyDialog::cancel_to_close(), NDK_XX::EditNumber::EditNumber(), and PushButton().

00429 {
00430     int max_len = width()-pos_x-has_frame();
00431     string new_text= v.substr(0, max_len); 
00432     text = new_text;
00433     clrtoeol(); 
00434     centertext(0,text.c_str());
00435     if(has_frame()){
00436         addch(0,0, '[');
00437         addch(0,maxx(), ']');
00438     }
00439     move(0,0);
00440     refresh();
00441 }


The documentation for this class was generated from the following files:
Generated on Thu Oct 10 16:02:22 2002 by doxygen1.2.17