KFormDesigner::PasteWidgetCommand Class Reference

#include <commands.h>

Inheritance diagram for KFormDesigner::PasteWidgetCommand:
KFormDesigner::Command

Public Member Functions

 PasteWidgetCommand (TQDomDocument &domDoc, Container *container, const TQPoint &p=TQPoint())
 
virtual void execute ()
 
virtual void unexecute ()
 
virtual TQString name () const
 
virtual void debug ()
 

Protected Member Functions

void changePos (TQDomElement &widg, const TQPoint &newpos)
 
void fixPos (TQDomElement &el, Container *container)
 
void moveWidgetBy (TQDomElement &el, Container *container, const TQPoint &p)
 
void fixNames (TQDomElement &el)
 

Protected Attributes

Form * m_form
 
TQCString m_data
 
TQString m_containername
 
TQPoint m_point
 
TQStringList m_names
 

Detailed Description

This command is used when pasting widgets. You need to give the TQDomDocument containing the widget(s) to paste, and optionnally the point where to paste widgets.

Definition at line 243 of file commands.h.

Constructor & Destructor Documentation

◆ PasteWidgetCommand()

PasteWidgetCommand::PasteWidgetCommand ( TQDomDocument &  domDoc,
Container *  container,
const TQPoint &  p = TQPoint() 
)

Definition at line 1057 of file commands.cpp.

Member Function Documentation

◆ changePos()

void PasteWidgetCommand::changePos ( TQDomElement &  widg,
const TQPoint &  newpos 
)
protected

Internal function used to change the coordinates of a widget to newpos before pasting it (to paste it at the position of the contextual menu). It modifies the "geometry" property of the TQDomElement representing the widget.

Definition at line 1207 of file commands.cpp.

◆ debug()

void PasteWidgetCommand::debug ( )
virtual

Implements KFormDesigner::Command.

Definition at line 1365 of file commands.cpp.

◆ execute()

void PasteWidgetCommand::execute ( )
virtual

Definition at line 1098 of file commands.cpp.

◆ fixNames()

void PasteWidgetCommand::fixNames ( TQDomElement &  el)
protected

Internal function used to fix the names of the widgets before pasting them. It prevents from pasting a widget with the same name as an actual widget. The child widgets are also fixed recursively.
If the name of the widget ends with a number (eg "TQLineEdit1"), the new name is just incremented by one (eg becomes "TQLineEdit2"). Otherwise, a "2" is just appended at the end of the name (eg "myWidget" becomes "myWidget2").

Definition at line 1329 of file commands.cpp.

◆ fixPos()

void PasteWidgetCommand::fixPos ( TQDomElement &  el,
Container *  container 
)
protected

Internal function used to fix the coordinates of a widget before pasting it (to avoid having two widgets at the same position). It moves the widget by (10, 10) increment (several times if there are already pasted widgets at this position).

Definition at line 1232 of file commands.cpp.

◆ moveWidgetBy()

void PasteWidgetCommand::moveWidgetBy ( TQDomElement &  el,
Container *  container,
const TQPoint &  p 
)
protected

Definition at line 1282 of file commands.cpp.

◆ name()

TQString PasteWidgetCommand::name ( ) const
virtual

Definition at line 1200 of file commands.cpp.

◆ unexecute()

void PasteWidgetCommand::unexecute ( )
virtual

Definition at line 1181 of file commands.cpp.

Member Data Documentation

◆ m_containername

TQString KFormDesigner::PasteWidgetCommand::m_containername
protected

Definition at line 274 of file commands.h.

◆ m_data

TQCString KFormDesigner::PasteWidgetCommand::m_data
protected

Definition at line 273 of file commands.h.

◆ m_form

Form* KFormDesigner::PasteWidgetCommand::m_form
protected

Definition at line 272 of file commands.h.

◆ m_names

TQStringList KFormDesigner::PasteWidgetCommand::m_names
protected

Definition at line 276 of file commands.h.

◆ m_point

TQPoint KFormDesigner::PasteWidgetCommand::m_point
protected

Definition at line 275 of file commands.h.


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