kexi

#include <container.h>

Public Types

enum  LayoutType {
  NoLayout =0 , HBox , VBox , Grid ,
  HFlow , VFlow , HSplitter , VSplitter
}

Public Slots

void setSelectedWidget (TQWidget *selected, bool add, bool dontRaise=false, bool moreWillBeSelected=false)
void unSelectWidget (TQWidget *w)
void deleteWidget (TQWidget *w)
void reloadLayout ()

Public Member Functions

 Container (Container *toplevel, TQWidget *container, TQObject *parent=0, const char *name=0)
Container * toplevel ()
Form * form () const
TQWidget * widget () const
ObjectTreeItem * objectTree () const
void setForm (Form *form)
void setObjectTree (ObjectTreeItem *t)
TQLayout * layout () const
LayoutType layoutType () const
int layoutMargin ()
int layoutSpacing ()
void setLayout (LayoutType type)
void setLayoutSpacing (int spacing)
void setLayoutMargin (int margin)
void stopInlineEditing ()
virtual bool eventFilter (TQObject *o, TQEvent *e)

Static Public Member Functions

static TQString layoutTypeToString (int type)
static LayoutType stringToLayoutType (const TQString &name)

Protected Slots

void widgetDeleted ()

Protected Member Functions

void createBoxLayout (WidgetList *list)
void createFlowLayout ()
void createGridLayout (bool testOnly=false)
void drawConnection (TQMouseEvent *mev)
void drawSelectionRect (TQMouseEvent *mev)
void drawInsertRect (TQMouseEvent *mev, TQObject *s)
void drawCopiedWidgetRect (TQMouseEvent *mev)
void moveSelectedWidgetsBy (int realdx, int realdy, TQMouseEvent *mev=0)

Friends

class InsertWidgetCommand
class PasteWidgetCommand
class DeleteWidgetCommand
class FormIO

Detailed Description

This class makes a container out of any TQWidget.

You can then create child widgets, and the background is dotted. A class to make a container from any widget

Definition at line 73 of file container.h.

Member Enumeration Documentation

◆ LayoutType

enum KFormDesigner::Container::LayoutType

Definition at line 79 of file container.h.

Constructor & Destructor Documentation

◆ Container()

Container::Container ( Container * toplevel,
TQWidget * container,
TQObject * parent = 0,
const char * name = 0 )

Creates a Container from the widget container, which have toplevel as parent Container.

Definition at line 91 of file container.cpp.

◆ ~Container()

Container::~Container ( )
virtual

Definition at line 136 of file container.cpp.

Member Function Documentation

◆ createBoxLayout()

void Container::createBoxLayout ( WidgetList * list)
protected

Internal function to create a HBoxLayout or VBoxLayout for this container. list is a subclass of TQObjectList that can sort widgets following their position (such as HorWidgetList or VerWidgetList).

Definition at line 655 of file container.cpp.

◆ createFlowLayout()

void Container::createFlowLayout ( )
protected

Internal function to create a KexiFlowLayout.

Definition at line 669 of file container.cpp.

◆ createGridLayout()

void Container::createGridLayout ( bool testOnly = false)
protected

Internal function to create a GridLayout. if testOnly is true, the layout is simulated, and only the widget's grid info aris filled.

Definition at line 733 of file container.cpp.

◆ deleteWidget

void Container::deleteWidget ( TQWidget * w)
slot

Deletes the widget w. Removes it from ObjectTree, and sets selection to Container's widget.

Definition at line 572 of file container.cpp.

◆ drawConnection()

void Container::drawConnection ( TQMouseEvent * mev)
protected

Drawing functions used by eventFilter.

Definition at line 944 of file container.cpp.

◆ drawCopiedWidgetRect()

void Container::drawCopiedWidgetRect ( TQMouseEvent * mev)
protected

Definition at line 1066 of file container.cpp.

◆ drawInsertRect()

void Container::drawInsertRect ( TQMouseEvent * mev,
TQObject * s )
protected

Definition at line 1020 of file container.cpp.

◆ drawSelectionRect()

void Container::drawSelectionRect ( TQMouseEvent * mev)
protected

moreWillBeSelected

Definition at line 986 of file container.cpp.

◆ eventFilter()

bool Container::eventFilter ( TQObject * o,
TQEvent * e )
virtual

This is the main function of Container, which filters the event sent to the watched widget.
It takes care of drawing the background and the insert rect, of creating the new child widgets, of moving the widgets and pop up a menu when right-clicking.

Definition at line 150 of file container.cpp.

◆ form()

Form * KFormDesigner::Container::form ( ) const
inline
Returns
The form this Container belongs to.

Definition at line 91 of file container.h.

◆ layout()

TQLayout * KFormDesigner::Container::layout ( ) const
inline
Returns
a pointer to the TQLayout of this Container, or 0 if there is not.

Definition at line 107 of file container.h.

◆ layoutMargin()

int KFormDesigner::Container::layoutMargin ( )
inline
Returns
the margin of this Container.

Definition at line 113 of file container.h.

◆ layoutSpacing()

int KFormDesigner::Container::layoutSpacing ( )
inline
Returns
the spacing of this Container.

Definition at line 116 of file container.h.

◆ layoutType()

LayoutType KFormDesigner::Container::layoutType ( ) const
inline
Returns
the type of the layout associated to this Container's widget (see LayoutType enum).

Definition at line 110 of file container.h.

◆ layoutTypeToString()

TQString Container::layoutTypeToString ( int type)
static
Returns
the string representing the layoutType type.

Definition at line 918 of file container.cpp.

◆ moveSelectedWidgetsBy()

void Container::moveSelectedWidgetsBy ( int realdx,
int realdy,
TQMouseEvent * mev = 0 )
protected

Other functions used by eventFilter.

Definition at line 1099 of file container.cpp.

◆ objectTree()

ObjectTreeItem * KFormDesigner::Container::objectTree ( ) const
inline
Returns
The ObjectTreeItem associated with this Container's widget.

Definition at line 97 of file container.h.

◆ reloadLayout

void Container::reloadLayout ( )
slot

Recreates the Container layout. Calls this when a widget has been moved or added to update the layout.

Definition at line 647 of file container.cpp.

◆ setForm()

void Container::setForm ( Form * form)

Sets the Form which this Container belongs to.

Definition at line 142 of file container.cpp.

◆ setLayout()

void Container::setLayout ( LayoutType type)

Layout functions.

Sets this Container to use type of layout. The widget are inserted automatically in the layout following their positions.

See also
createBoxLayout(), createGridLayout()

Definition at line 592 of file container.cpp.

◆ setLayoutMargin()

void KFormDesigner::Container::setLayoutMargin ( int margin)
inline

Sets the margin of this Container.

Definition at line 127 of file container.h.

◆ setLayoutSpacing()

void KFormDesigner::Container::setLayoutSpacing ( int spacing)
inline

Sets the spacing of this Container.

Definition at line 124 of file container.h.

◆ setObjectTree()

void KFormDesigner::Container::setObjectTree ( ObjectTreeItem * t)
inline

Sets the ObjectTree of this Container.
NOTE: this is needed only if we are toplevel.

Definition at line 104 of file container.h.

◆ setSelectedWidget

void Container::setSelectedWidget ( TQWidget * selected,
bool add,
bool dontRaise = false,
bool moreWillBeSelected = false )
slot

Sets selected to be the selected widget of this container (and so of the Form). If add is true, the formerly selected widget is still selected, and the new one is just added. If false, selected replace the actually selected widget. If dontRaise is true, then the widget selected (and its parent) won't be raised (eg when you select widget in ObjectTreeView).

See also
Form::setSelectedWidget()

Definition at line 539 of file container.cpp.

◆ stopInlineEditing()

void KFormDesigner::Container::stopInlineEditing ( )
inline

Stops the inline editing of the current widget (as when you click on another widget or press Esc).

Definition at line 137 of file container.h.

◆ stringToLayoutType()

Container::LayoutType Container::stringToLayoutType ( const TQString & name)
static
Returns
the LayoutType (an int) for a given layout name.

Definition at line 932 of file container.cpp.

◆ toplevel()

Container * Container::toplevel ( )
Returns
a pointer to the toplevel Container, or 0 if this Container is toplevel

Definition at line 563 of file container.cpp.

◆ unSelectWidget

void Container::unSelectWidget ( TQWidget * w)
slot

Unselects the widget w. The widget is removed from the Form's list and its resizeHandles are removed.

Definition at line 554 of file container.cpp.

◆ widget()

TQWidget * KFormDesigner::Container::widget ( ) const
inline
Returns
The watched widget.

Definition at line 94 of file container.h.

◆ widgetDeleted

void Container::widgetDeleted ( )
protectedslot

This slot is called when the watched widget is deleted. Deletes the Container too.

Definition at line 583 of file container.cpp.

◆ DeleteWidgetCommand

friend class DeleteWidgetCommand
friend

Definition at line 226 of file container.h.

◆ FormIO

friend class FormIO
friend

Definition at line 227 of file container.h.

◆ InsertWidgetCommand

friend class InsertWidgetCommand
friend

Definition at line 224 of file container.h.

◆ PasteWidgetCommand

friend class PasteWidgetCommand
friend

Definition at line 225 of file container.h.


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