kexi

#include <kexibooltableedit.h>

Inheritance diagram for KexiBoolTableEdit:
KexiTableEdit KexiDataItemInterface

Signals

void hintClicked ()
Signals inherited from KexiTableEdit
void editRequested ()
void cancelRequested ()
void acceptRequested ()

Public Member Functions

 KexiBoolTableEdit (KexiTableViewColumn &column, TQWidget *parent=0)
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
virtual TQVariant value ()
virtual bool cursorAtStart ()
virtual bool cursorAtEnd ()
virtual void clear ()
virtual void setupContents (TQPainter *p, bool focused, const TQVariant &val, TQString &txt, int &align, int &x, int &y_offset, int &w, int &h)
virtual void clickedOnContents ()
virtual void handleAction (const TQString &actionName)
virtual void handleCopyAction (const TQVariant &value, const TQVariant &visibleValue)
virtual int widthForValue (TQVariant &val, const TQFontMetrics &fm)
Public Member Functions inherited from KexiTableEdit
 KexiTableEdit (KexiTableViewColumn &column, TQWidget *parent=0)
virtual KexiDB::Field * field () const
virtual KexiDB::QueryColumnInfo * columnInfo () const
virtual void setColumnInfo (KexiDB::QueryColumnInfo *)
KexiTableViewColumn * column () const
KexiDB::Field * displayedField () const
virtual void resize (int w, int h)
virtual TQWidget * widget ()
virtual void hideWidget ()
virtual void showWidget ()
virtual void paintFocusBorders (TQPainter *p, TQVariant &cal, int x, int y, int w, int h)
bool usesSelectedTextColor () const
virtual void paintSelectionBackground (TQPainter *p, bool focused, const TQString &txt, int align, int x, int y_offset, int w, int h, const TQColor &fillColor, const TQFontMetrics &fm, bool readOnly, bool fullRowSelection)
int leftMargin () const
int rightMargin (bool focused) const
virtual bool handleKeyPress (TQKeyEvent *ke, bool editorActive)
virtual bool handleDoubleClick ()
virtual TQSize totalSize ()
virtual bool showToolTipIfNeeded (const TQVariant &value, const TQRect &rect, const TQFontMetrics &fm, bool focused)
virtual void createInternalEditor (KexiDB::QuerySchema &schema)
Public Member Functions inherited from KexiDataItemInterface
void setValue (const TQVariant &value, const TQVariant &add=TQVariant(), bool removeOld=false, const TQVariant *visibleValue=0)
virtual void installListener (KexiDataItemChangesListener *listener)
virtual bool valueIsValid ()
virtual TQVariant visibleValue ()
virtual bool isReadOnly () const
virtual bool valueChanged ()
virtual void moveCursorToEnd ()
virtual void moveCursorToStart ()
virtual void selectAll ()
bool hasFocusableWidget () const
virtual void showFocus (const TQRect &r, bool readOnly)
virtual void hideFocus ()
bool acceptEditorAfterDeleteContents () const
virtual void setFocus ()
bool cursorAtNewRow ()
void setParentDataItemInterface (KexiDataItemInterface *parentDataItemInterface)
KexiDataItemInterface * parentInterface () const

Protected Member Functions

virtual void setValueInternal (const TQVariant &add, bool removeOld)
void showHintButton ()
Protected Member Functions inherited from KexiTableEdit
virtual bool eventFilter (TQObject *watched, TQEvent *e)
void setViewWidget (TQWidget *v)
void moveChild (TQWidget *child, int x, int y)
void repaintRelatedCell ()
Protected Member Functions inherited from KexiDataItemInterface
virtual void setVisibleValueInternal (const TQVariant &value)
virtual void signalValueChanged ()
virtual void beforeSignalValueChanged ()
KexiDataItemChangesListener * listener ()

Protected Attributes

TQVariant m_currentValue
Protected Attributes inherited from KexiTableEdit
KexiTableViewColumn * m_column
int m_leftMargin
int m_rightMargin
int m_rightMarginWhenFocused
TQScrollView * m_scrollView
bool m_usesSelectedTextColor: 1
Protected Attributes inherited from KexiDataItemInterface
TQGuardedPtr< TQObject > m_listenerObject
KexiDataItemChangesListener * m_listener
bool m_listenerIsTQObject
TQVariant m_origValue
KexiDataItemInterface * m_parentDataItemInterface
bool m_hasFocusableWidget: 1
bool m_disable_signalValueChanged: 1
bool m_acceptEditorAfterDeleteContents: 1

Detailed Description

Cell editor for boolean type.

Definition at line 30 of file kexibooltableedit.h.

Constructor & Destructor Documentation

◆ KexiBoolTableEdit()

KexiBoolTableEdit::KexiBoolTableEdit ( KexiTableViewColumn & column,
TQWidget * parent = 0 )

Definition at line 34 of file kexibooltableedit.cpp.

◆ ~KexiBoolTableEdit()

KexiBoolTableEdit::~KexiBoolTableEdit ( )
virtual

Definition at line 45 of file kexibooltableedit.cpp.

Member Function Documentation

◆ clear()

void KexiBoolTableEdit::clear ( )
virtual

clears item's data, so the data will contain NULL data

Implements KexiDataItemInterface.

Definition at line 71 of file kexibooltableedit.cpp.

◆ clickedOnContents()

void KexiBoolTableEdit::clickedOnContents ( )
virtual

Allows to define reaction for clicking on cell's contents. Currently it's used for editor of type boolean, where we want to toggle true/false on single mouse click.

See also
hasFocusableWidget(), KexiBoolTableEdit. Default implementation does nothing.

Reimplemented from KexiDataItemInterface.

Definition at line 120 of file kexibooltableedit.cpp.

◆ cursorAtEnd()

bool KexiBoolTableEdit::cursorAtEnd ( )
virtual
Returns
true if the item widget's cursor (whatever that means, eg. line edit cursor) is at the end of editor's contents. This can inform table/form view that after pressing "right arrow" key should stop editing and move to a field on the right hand.

Implements KexiDataItemInterface.

Definition at line 84 of file kexibooltableedit.cpp.

◆ cursorAtStart()

bool KexiBoolTableEdit::cursorAtStart ( )
virtual
Returns
true if the item widget's cursor (whatever that means, eg. line edit cursor) is at the beginning of editor's contents. This can inform table/form view that after pressing "left arrow" key should stop editing and move to a field on the left hand.

Implements KexiDataItemInterface.

Definition at line 79 of file kexibooltableedit.cpp.

◆ handleAction()

void KexiBoolTableEdit::handleAction ( const TQString & actionName)
virtual

Handles action having standard name actionName. Action could be: "edit_cut", "edit_paste", etc.

Todo
handle defaultValue...

Reimplemented from KexiDataItemInterface.

Definition at line 133 of file kexibooltableedit.cpp.

◆ handleCopyAction()

void KexiBoolTableEdit::handleCopyAction ( const TQVariant & value,
const TQVariant & visibleValue )
virtual

Handles copy action for value. Copies empty string for null, "1" for true, "0" for false. visibleValue is unused here. Reimplemented after KexiTableEdit.

Implements KexiTableEdit.

Definition at line 158 of file kexibooltableedit.cpp.

◆ setupContents()

void KexiBoolTableEdit::setupContents ( TQPainter * p,
bool focused,
const TQVariant & val,
TQString & txt,
int & align,
int & x,
int & y_offset,
int & w,
int & h )
virtual

For reimplementation. Sets up and paints cell's contents using context of val value. focused is true if the cell is focused. align is set using TQt::AlignmentFlags. Some additional things may be painted using p, but it is not needed to paint the text (this is done automatically outside of this method).

Before calling, x, y_offset, w, h parameters are initialized, but you can tune these values depending on the context. You should set txt to a text representation of val, otherwise no text will be painted.

p can be 0 - in this case no painting should be performed, becasue caller only expects that x, y_offset, w, h, txt parameters are tuned, if needed. p painter's pen is set to foreground color (usually black) that should be used to paint foreground information, if needed. For example boolean editor widget paints a rectangle using this color.

Todo
ADD OPTION to displaying NULL VALUES as e.g. "(null)"

Reimplemented from KexiTableEdit.

Definition at line 89 of file kexibooltableedit.cpp.

◆ setValueInternal()

void KexiBoolTableEdit::setValueInternal ( const TQVariant & add,
bool removeOld )
protectedvirtual

initializes this editor with add value

Implements KexiDataItemInterface.

Definition at line 49 of file kexibooltableedit.cpp.

◆ value()

TQVariant KexiBoolTableEdit::value ( )
virtual
Returns
value currently represented by this item.

Implements KexiDataItemInterface.

Definition at line 65 of file kexibooltableedit.cpp.

◆ valueIsEmpty()

bool KexiBoolTableEdit::valueIsEmpty ( )
virtual
Returns
true if editor's value is empty (not null). Only few field types can accept "EMPTY" property (check this with KexiDB::Field::hasEmptyProperty()),

Implements KexiDataItemInterface.

Definition at line 60 of file kexibooltableedit.cpp.

◆ valueIsNull()

bool KexiBoolTableEdit::valueIsNull ( )
virtual
Returns
true if editor's value is null (not empty)

Implements KexiDataItemInterface.

Definition at line 55 of file kexibooltableedit.cpp.

◆ widthForValue()

int KexiBoolTableEdit::widthForValue ( TQVariant & val,
const TQFontMetrics & fm )
virtual
Returns
width of value. Reimplemented after KexiTableEdit.

Reimplemented from KexiTableEdit.

Definition at line 167 of file kexibooltableedit.cpp.

Member Data Documentation

◆ m_currentValue

TQVariant KexiBoolTableEdit::m_currentValue
protected

We've no editor widget that would store current value, so we do this here.

Definition at line 80 of file kexibooltableedit.h.


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