kalarm

PickFileRadio Class Referenceabstract

#include <pickfileradio.h>

Inherits RadioButton.

Inherited by PickAlarmFileRadio, and PickLogFileRadio.

Public Slots

virtual void setEnabled (bool)
 

Public Member Functions

 PickFileRadio (TQPushButton *button, LineEdit *edit, const TQString &text, TQButtonGroup *parent, const char *name=0)
 
 PickFileRadio (const TQString &text, TQButtonGroup *parent, const char *name=0)
 
void init (TQPushButton *button, LineEdit *edit=0)
 
virtual void setReadOnly (bool readOnly)
 
virtual TQString pickFile ()=0
 
void setFile (const TQString &file)
 
TQString file () const
 
LineEdit * fileEdit () const
 
TQPushButton * pushButton () const
 

Detailed Description

Radio button with associated file picker controls.

The PickFileRadio class is a radio button with an associated button to choose a file, and an optional file name edit box. Its purpose is to ensure that while the radio button is selected, the chosen file name is never blank.

To achieve this, whenever the button is newly selected and the file name is currently blank, the file picker dialogue is displayed to choose a file. If the dialogue exits without a file being chosen, the radio button selection is reverted to the previously selected button in the parent button group.

The class handles the activation of the file picker dialogue (via a virtual method which must be supplied by deriving a class from this one). It also handles all enabling and disabling of the browse button and edit box when the enable state of the radio button is changed, and when the radio button selection changes.

Author
David Jarvie softw.nosp@m.are@.nosp@m.astro.nosp@m.jar..nosp@m.org.u.nosp@m.k

Definition at line 50 of file pickfileradio.h.

Constructor & Destructor Documentation

◆ PickFileRadio() [1/2]

PickFileRadio::PickFileRadio ( TQPushButton *  button,
LineEdit *  edit,
const TQString &  text,
TQButtonGroup *  parent,
const char *  name = 0 
)

Constructor.

Parameters
buttonPush button to invoke the file picker dialogue.
editFile name edit widget, or null if there is none.
textRadio button's text.
parentButton group which is to be the parent object for the radio button.
nameThe name of this widget.

Definition at line 33 of file pickfileradio.cpp.

◆ PickFileRadio() [2/2]

PickFileRadio::PickFileRadio ( const TQString &  text,
TQButtonGroup *  parent,
const char *  name = 0 
)

Constructor.

The init() method must be called before the widget can be used.

Parameters
textRadio button's text.
parentButton group which is to be the parent object for the radio button.
nameThe name of this widget.

Definition at line 50 of file pickfileradio.cpp.

Member Function Documentation

◆ file()

TQString PickFileRadio::file ( ) const

Returns the currently selected file name.

Definition at line 93 of file pickfileradio.cpp.

◆ fileEdit()

LineEdit* PickFileRadio::fileEdit ( ) const
inline

Returns the associated file name edit widget, or null if none.

Definition at line 95 of file pickfileradio.h.

◆ init()

void PickFileRadio::init ( TQPushButton *  button,
LineEdit *  edit = 0 
)

Initialises the widget.

Parameters
buttonPush button to invoke the file picker dialogue.
editFile name edit widget, or null if there is none.

Definition at line 61 of file pickfileradio.cpp.

◆ pickFile()

virtual TQString PickFileRadio::pickFile ( )
pure virtual

Chooses a file, for example by displaying a file selection dialogue.

This method is called when the push button is clicked - the client should not activate a file selection dialogue directly.

Returns
Selected file name, or TQString() if no selection made.

◆ pushButton()

TQPushButton* PickFileRadio::pushButton ( ) const
inline

Returns the associated file browse push button.

Definition at line 97 of file pickfileradio.h.

◆ setEnabled

void PickFileRadio::setEnabled ( bool  enable)
virtualslot

Enables or disables the radio button, and adjusts the enabled state of the associated browse button and file name edit box.

Definition at line 102 of file pickfileradio.cpp.

◆ setFile()

void PickFileRadio::setFile ( const TQString &  file)

Notifies the widget of the currently selected file name.

This should only be used when no file name edit box is used. It should be called to initialise the widget's data, and also any time the file name is changed without using the push button.

Definition at line 88 of file pickfileradio.cpp.

◆ setReadOnly()

void PickFileRadio::setReadOnly ( bool  readOnly)
virtual

Sets whether the radio button and associated widgets are read-only for the user.

If read-only, their states cannot be changed by the user.

Parameters
readOnlyTrue to set the widgets read-only, false to set them read-write.

Definition at line 74 of file pickfileradio.cpp.


The documentation for this class was generated from the following files: