summaryrefslogtreecommitdiffstats
path: root/src/widgets/tqaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/tqaction.cpp')
-rw-r--r--src/widgets/tqaction.cpp140
1 files changed, 70 insertions, 70 deletions
diff --git a/src/widgets/tqaction.cpp b/src/widgets/tqaction.cpp
index 63a7896c5..8a590cced 100644
--- a/src/widgets/tqaction.cpp
+++ b/src/widgets/tqaction.cpp
@@ -83,7 +83,7 @@
they are invoked. Use setToggleAction() to set an action's toggled
status. To see if an action is a toggle action use
isToggleAction(). A toggle action may be "on", isOn() returns
- TRUE, or "off", isOn() returns FALSE.
+ true, or "off", isOn() returns false.
Actions are added to widgets (menus or toolbars) using addTo(),
and removed using removeFrom().
@@ -181,17 +181,17 @@ TQActionPrivate::TQActionPrivate(TQAction *act)
#ifndef TQT_NO_ACCEL
key( 0 ), accel( 0 ), accelid( 0 ),
#endif
- enabled( TRUE ), visible( TRUE ), toggleaction( FALSE ), on( FALSE ),
- forceDisabled( FALSE ), forceInvisible( FALSE ),
+ enabled( true ), visible( true ), toggleaction( false ), on( false ),
+ forceDisabled( false ), forceInvisible( false ),
#ifndef TQT_NO_TOOLTIP
tipGroup( 0 ),
#endif
d_group( 0 ), action(act)
{
- menuitems.setAutoDelete( TRUE );
- comboitems.setAutoDelete( TRUE );
+ menuitems.setAutoDelete( true );
+ comboitems.setAutoDelete( true );
#ifndef TQT_NO_TOOLTIP
- tipGroup.setDelay( FALSE );
+ tipGroup.setDelay( false );
#endif
}
@@ -298,7 +298,7 @@ void TQActionPrivate::update( uint upd )
if ( !whatsthis.isEmpty() )
mi->popup->setWhatsThis( mi->id, whatsthis );
if ( toggleaction ) {
- mi->popup->setCheckable( TRUE );
+ mi->popup->setCheckable( true );
mi->popup->setItemChecked( mi->id, on );
}
}
@@ -321,7 +321,7 @@ void TQActionPrivate::update( uint upd )
if ( upd & EverythingElse ) {
btn->setToggleButton( toggleaction );
if ( !text.isEmpty() )
- btn->setTextLabel( text, FALSE );
+ btn->setTextLabel( text, false );
#ifndef TQT_NO_TOOLTIP
TQToolTip::remove( btn );
TQToolTip::add( btn, toolTip(), &tipGroup, statusTip() );
@@ -413,7 +413,7 @@ TQAction::TQAction( TQObject* parent, const char* name )
/*! \obsolete
Constructs an action called \a name with parent \a parent.
- If \a toggle is TRUE the action will be a toggle action, otherwise
+ If \a toggle is true the action will be a toggle action, otherwise
it will be a command action.
If \a parent is a TQActionGroup, the new action inserts itself into
@@ -452,7 +452,7 @@ TQAction::TQAction( TQObject* parent, const char* name, bool toggle )
used for tool tips and status tips unless you provide text for
these using setToolTip() and setStatusTip().
- Call setToggleAction(TRUE) to make the action a toggle action.
+ Call setToggleAction(true) to make the action a toggle action.
\warning To prevent recursion, don't create an action as a child
of a widget that the action is later added to.
@@ -488,7 +488,7 @@ TQAction::TQAction( const TQIconSet& icon, const TQString& menuText, TQKeySequen
used for tool tips and status tips unless you provide text for
these using setToolTip() and setStatusTip().
- Call setToggleAction(TRUE) to make the action a toggle action.
+ Call setToggleAction(true) to make the action a toggle action.
\warning To prevent recursion, don't create an action as a child
of a widget that the action is later added to.
@@ -508,7 +508,7 @@ TQAction::TQAction( const TQString& menuText, TQKeySequence accel,
This constructor creates an action with the following properties:
the description \a text, the icon or iconset \a icon, the menu
text \a menuText and keyboard accelerator \a accel. It is a child
- of \a parent and called \a name. If \a toggle is TRUE the action
+ of \a parent and called \a name. If \a toggle is true the action
will be a toggle action, otherwise it will be a command action.
If \a parent is a TQActionGroup, the action automatically becomes
@@ -539,7 +539,7 @@ TQAction::TQAction( const TQString& text, const TQIconSet& icon, const TQString&
This constructor results in an icon-less action with the
description \a text, the menu text \a menuText and the keyboard
accelerator \a accel. Its parent is \a parent and it is called \a
- name. If \a toggle is TRUE the action will be a toggle action,
+ name. If \a toggle is true the action will be a toggle action,
otherwise it will be a command action.
The action automatically becomes a member of \a parent if \a
@@ -617,7 +617,7 @@ TQIconSet TQAction::iconSet() const
\property TQAction::text
\brief the action's descriptive text
- If \l TQMainWindow::usesTextLabel is TRUE, the text appears as a
+ If \l TQMainWindow::usesTextLabel is true, the text appears as a
label in the relevant tool button. It also serves as the default
text in menus and tool tips if these have not been specifically
defined. There is no default text.
@@ -806,14 +806,14 @@ TQKeySequence TQAction::accel() const
A toggle action is one which has an on/off state. For example a
Bold toolbar button is either on or off. An action which is not a
toggle action is a command action; a command action is simply
- executed, e.g. file save. This property's default is FALSE.
+ executed, e.g. file save. This property's default is false.
In some situations, the state of one toggle action should depend
on the state of others. For example, "Left Align", "Center" and
"Right Align" toggle actions are mutually exclusive. To achieve
exclusive toggling, add the relevant toggle actions to a
TQActionGroup with the \l TQActionGroup::exclusive property set to
- TRUE.
+ true.
*/
void TQAction::setToggleAction( bool enable )
{
@@ -821,7 +821,7 @@ void TQAction::setToggleAction( bool enable )
return;
if ( !enable )
- d->on = FALSE;
+ d->on = false;
d->toggleaction = enable;
d->update();
@@ -871,10 +871,10 @@ void TQAction::toggle()
\property TQAction::on
\brief whether a toggle action is on
- This property is always on (TRUE) for command actions and
+ This property is always on (true) for command actions and
\l{TQActionGroup}s; setOn() has no effect on them. For action's
- where isToggleAction() is TRUE, this property's default value is
- off (FALSE).
+ where isToggleAction() is true, this property's default value is
+ off (false).
\sa toggleAction
*/
@@ -929,7 +929,7 @@ bool TQAction::isEnabled() const
}
/*!
- Disables the action if \a disable is TRUE; otherwise
+ Disables the action if \a disable is true; otherwise
enables the action.
See the \l enabled documentation for more information.
@@ -943,8 +943,8 @@ void TQAction::setDisabled( bool disable )
\property TQAction::visible
\brief whether the action can be seen (e.g. in menus and toolbars)
- If \e visible is TRUE the action can be seen (e.g. in menus and
- toolbars) and chosen by the user; if \e visible is FALSE the
+ If \e visible is true the action can be seen (e.g. in menus and
+ toolbars) and chosen by the user; if \e visible is false the
action cannot be seen or chosen by the user.
Actions which are not visible are \e not grayed out; they do not
@@ -963,8 +963,8 @@ void TQAction::setVisible( bool visible )
}
/*
- Returns TRUE if the action is visible (e.g. in menus and
- toolbars); otherwise returns FALSE.
+ Returns true if the action is visible (e.g. in menus and
+ toolbars); otherwise returns false.
*/
bool TQAction::isVisible() const
{
@@ -997,9 +997,9 @@ void TQAction::toolButtonToggled( bool on )
An action added to a tool bar is automatically displayed as a tool
button; an action added to a pop up menu appears as a menu option.
- addTo() returns TRUE if the action was added successfully and
- FALSE otherwise. (If \a w is not a TQToolBar or TQPopupMenu the
- action will not be added and FALSE will be returned.)
+ addTo() returns true if the action was added successfully and
+ false otherwise. (If \a w is not a TQToolBar or TQPopupMenu the
+ action will not be added and false will be returned.)
\sa removeFrom()
*/
@@ -1065,9 +1065,9 @@ bool TQAction::addTo( TQWidget* w )
d->update( TQActionPrivate::State | TQActionPrivate::EverythingElse );
} else {
tqWarning( "TQAction::addTo(), unknown object" );
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*!
@@ -1121,7 +1121,7 @@ void TQAction::showStatusText( const TQString& text )
TQStatusBar *bar = 0;
while ( par && !bar ) {
lpar = par;
- bar = (TQStatusBar*)par->child( 0, "TQStatusBar", FALSE );
+ bar = (TQStatusBar*)par->child( 0, "TQStatusBar", false );
par = par->parent();
}
if ( !bar && lpar ) {
@@ -1178,8 +1178,8 @@ void TQAction::clearStatusText()
/*!
Removes the action from widget \a w.
- Returns TRUE if the action was removed successfully; otherwise
- returns FALSE.
+ Returns true if the action was removed successfully; otherwise
+ returns false.
\sa addTo()
*/
@@ -1225,9 +1225,9 @@ bool TQAction::removeFrom( TQWidget* w )
}
} else {
tqWarning( "TQAction::removeFrom(), unknown object" );
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*!
@@ -1270,8 +1270,8 @@ void TQAction::objectDestroyed()
This signal is emitted when a toggle action changes state; command
actions and \l{TQActionGroup}s don't emit toggled().
- The \a on argument denotes the new state: If \a on is TRUE the
- toggle action is switched on, and if \a on is FALSE the toggle
+ The \a on argument denotes the new state: If \a on is true the
+ toggle action is switched on, and if \a on is false the toggle
action is switched off.
To trigger a user command depending on whether a toggle action has
@@ -1293,16 +1293,16 @@ void TQActionGroupPrivate::update( const TQActionGroup* that )
{
for ( TQPtrListIterator<TQAction> it( actions ); it.current(); ++it ) {
if ( that->isEnabled() && !it.current()->d->forceDisabled ) {
- it.current()->setEnabled( TRUE );
+ it.current()->setEnabled( true );
} else if ( !that->isEnabled() && it.current()->isEnabled() ) {
- it.current()->setEnabled( FALSE );
- it.current()->d->forceDisabled = FALSE;
+ it.current()->setEnabled( false );
+ it.current()->d->forceDisabled = false;
}
if ( that->isVisible() && !it.current()->d->forceInvisible ) {
- it.current()->setVisible( TRUE );
+ it.current()->setVisible( true );
} else if ( !that->isVisible() && it.current()->isVisible() ) {
- it.current()->setVisible( FALSE );
- it.current()->d->forceInvisible = FALSE;
+ it.current()->setVisible( false );
+ it.current()->d->forceInvisible = false;
}
}
for ( TQPtrListIterator<TQComboBox> cb( comboboxes ); cb.current(); ++cb ) {
@@ -1415,7 +1415,7 @@ void TQActionGroupPrivate::update( const TQActionGroup* that )
The setExclusive() function is used to ensure that only one action
is active at any one time: it should be used with actions which
- have their \c toggleAction set to TRUE.
+ have their \c toggleAction set to true.
Action group actions appear as individual menu options and toolbar
buttons. For exclusive action groups use setUsesDropDown() to
@@ -1432,15 +1432,15 @@ void TQActionGroupPrivate::update( const TQActionGroup* that )
/*!
Constructs an action group called \a name, with parent \a parent.
- The action group is exclusive by default. Call setExclusive(FALSE) to make
+ The action group is exclusive by default. Call setExclusive(false) to make
the action group non-exclusive.
*/
TQActionGroup::TQActionGroup( TQObject* parent, const char* name )
: TQAction( parent, name )
{
d = new TQActionGroupPrivate;
- d->exclusive = TRUE;
- d->dropdown = FALSE;
+ d->exclusive = true;
+ d->dropdown = false;
d->selected = 0;
d->separatorAction = 0;
TQAction::d->d_group = d;
@@ -1451,7 +1451,7 @@ TQActionGroup::TQActionGroup( TQObject* parent, const char* name )
/*!
Constructs an action group called \a name, with parent \a parent.
- If \a exclusive is TRUE only one toggle action in the group will
+ If \a exclusive is true only one toggle action in the group will
ever be active.
\sa exclusive
@@ -1461,7 +1461,7 @@ TQActionGroup::TQActionGroup( TQObject* parent, const char* name, bool exclusive
{
d = new TQActionGroupPrivate;
d->exclusive = exclusive;
- d->dropdown = FALSE;
+ d->dropdown = false;
d->selected = 0;
d->separatorAction = 0;
TQAction::d->d_group = d;
@@ -1503,10 +1503,10 @@ TQActionGroup::~TQActionGroup()
}
delete d->separatorAction;
- d->menubuttons.setAutoDelete( TRUE );
- d->comboboxes.setAutoDelete( TRUE );
- d->menuitems.setAutoDelete( TRUE );
- d->popupmenus.setAutoDelete( TRUE );
+ d->menubuttons.setAutoDelete( true );
+ d->comboboxes.setAutoDelete( true );
+ d->menuitems.setAutoDelete( true );
+ d->popupmenus.setAutoDelete( true );
delete d;
}
@@ -1514,7 +1514,7 @@ TQActionGroup::~TQActionGroup()
\property TQActionGroup::exclusive
\brief whether the action group does exclusive toggling
- If exclusive is TRUE only one toggle action in the action group
+ If exclusive is true only one toggle action in the action group
can ever be active at any one time. If the user chooses another
toggle action in the group the one they chose becomes active and
the one that was active becomes inactive.
@@ -1552,7 +1552,7 @@ bool TQActionGroup::isExclusive() const
\link TQAction::setEnabled()\endlink, and
\link TQAction::setDisabled()\endlink functions to have no effect.
- This property's default is FALSE.
+ This property's default is false.
*/
void TQActionGroup::setUsesDropDown( bool enable )
@@ -1633,12 +1633,12 @@ void TQActionGroup::addSeparator()
/*!
Adds this action group to the widget \a w.
- If isExclusive() is FALSE or usesDropDown() is FALSE, the actions within
+ If isExclusive() is false or usesDropDown() is false, the actions within
the group are added to the widget individually. For example, if the widget
is a menu, the actions will appear as individual menu options, and
if the widget is a toolbar, the actions will appear as toolbar buttons.
- If both isExclusive() and usesDropDown() are TRUE, the actions
+ If both isExclusive() and usesDropDown() are true, the actions
are presented either in a combobox (if \a w is a toolbar) or in a
submenu (if \a w is a menu).
@@ -1657,7 +1657,7 @@ bool TQActionGroup::addTo( TQWidget* w )
if ( !d->exclusive ) {
TQPtrListIterator<TQAction> it( d->actions);
if ( !it.current() )
- return TRUE;
+ return true;
TQAction *defAction = it.current();
@@ -1700,9 +1700,9 @@ bool TQActionGroup::addTo( TQWidget* w )
++it;
}
d->update( this );
- return TRUE;
+ return true;
} else {
- TQComboBox *box = new TQComboBox( FALSE, w, "qt_actiongroup_combo" );
+ TQComboBox *box = new TQComboBox( false, w, "qt_actiongroup_combo" );
addedTo( box, w );
connect( box, TQ_SIGNAL(destroyed()), TQ_SLOT(objectDestroyed()) );
d->comboboxes.append( box );
@@ -1716,7 +1716,7 @@ bool TQActionGroup::addTo( TQWidget* w )
#endif
int onIndex = 0;
- bool foundOn = FALSE;
+ bool foundOn = false;
for ( TQPtrListIterator<TQAction> it( d->actions); it.current(); ++it ) {
TQAction *action = it.current();
if ( !foundOn )
@@ -1730,7 +1730,7 @@ bool TQActionGroup::addTo( TQWidget* w )
connect( box, TQ_SIGNAL(activated(int)), this, TQ_SLOT( internalComboBoxActivated(int)) );
connect( box, TQ_SIGNAL(highlighted(int)), this, TQ_SLOT( internalComboBoxHighlighted(int)) );
d->update( this );
- return TRUE;
+ return true;
}
}
} else
@@ -1769,7 +1769,7 @@ bool TQActionGroup::addTo( TQWidget* w )
// #### do an addedTo( index, popup, action), need to find out index
it.current()->addTo( popup );
}
- return TRUE;
+ return true;
}
for ( TQPtrListIterator<TQAction> it( d->actions); it.current(); ++it ) {
@@ -1777,7 +1777,7 @@ bool TQActionGroup::addTo( TQWidget* w )
it.current()->addTo( w );
}
- return TRUE;
+ return true;
}
/*! \reimp
@@ -1817,7 +1817,7 @@ bool TQActionGroup::removeFrom( TQWidget* w )
}
}
- return TRUE;
+ return true;
}
/*! \internal
@@ -1832,7 +1832,7 @@ void TQActionGroup::childToggled( bool b )
d->selected = s;
for ( TQPtrListIterator<TQAction> it( d->actions); it.current(); ++it ) {
if ( it.current()->isToggleAction() && it.current() != s )
- it.current()->setOn( FALSE );
+ it.current()->setOn( false );
}
emit activated();
emit selected( s );
@@ -1842,7 +1842,7 @@ void TQActionGroup::childToggled( bool b )
} else {
if ( s == d->selected ) {
// at least one has to be selected
- s->setOn( TRUE );
+ s->setOn( true );
}
}
}
@@ -1874,7 +1874,7 @@ void TQActionGroup::setToggleAction( bool toggle )
for ( TQPtrListIterator<TQAction> it( d->actions); it.current(); ++it )
it.current()->setToggleAction( toggle );
- TQAction::setToggleAction( TRUE );
+ TQAction::setToggleAction( true );
d->update( this );
}
@@ -2010,10 +2010,10 @@ void TQActionGroup::internalComboBoxActivated( int index )
d->selected = a;
for ( TQPtrListIterator<TQAction> it( d->actions); it.current(); ++it ) {
if ( it.current()->isToggleAction() && it.current() != a )
- it.current()->setOn( FALSE );
+ it.current()->setOn( false );
}
if ( a->isToggleAction() )
- a->setOn( TRUE );
+ a->setOn( true );
emit activated();
if ( a->isToggleAction() )