kexi

#include <kexicomboboxtableedit.h>

Inheritance diagram for KexiComboBoxTableEdit:
KexiInputTableEdit KexiComboBoxBase KexiTableEdit KexiDataItemInterface

Public Slots

virtual void moveCursorToEnd ()
virtual void moveCursorToStart ()
virtual void selectAll ()
Public Slots inherited from KexiInputTableEdit
virtual void moveCursorToEnd ()
virtual void moveCursorToStart ()
virtual void selectAll ()

Public Member Functions

 KexiComboBoxTableEdit (KexiTableViewColumn &column, TQWidget *parent=0)
virtual KexiTableViewColumn * column () const
virtual KexiDB::Field * field () const
virtual TQVariant origValue () const
virtual void setValueInternal (const TQVariant &add, bool removeOld)
virtual TQVariant value ()
virtual void clear ()
virtual bool valueChanged ()
virtual TQVariant visibleValue ()
virtual void resize (int w, int h)
virtual void showFocus (const TQRect &r, bool readOnly)
virtual void hideFocus ()
virtual void paintFocusBorders (TQPainter *p, TQVariant &cal, int x, int y, int w, int h)
virtual void setupContents (TQPainter *p, bool focused, const TQVariant &val, TQString &txt, int &align, int &x, int &y_offset, int &w, int &h)
virtual bool handleKeyPress (TQKeyEvent *ke, bool editorActive)
virtual int widthForValue (TQVariant &val, const TQFontMetrics &fm)
virtual void hide ()
virtual void show ()
virtual TQSize totalSize () const
virtual void createInternalEditor (KexiDB::QuerySchema &schema)
virtual void handleAction (const TQString &actionName)
virtual void handleCopyAction (const TQVariant &value, const TQVariant &visibleValue)
Public Member Functions inherited from KexiInputTableEdit
 KexiInputTableEdit (KexiTableViewColumn &column, TQWidget *parent=0)
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
virtual bool cursorAtStart ()
virtual bool cursorAtEnd ()
virtual TQSize totalSize ()
virtual bool showToolTipIfNeeded (const TQVariant &value, const TQRect &rect, const TQFontMetrics &fm, bool focused)
Public Member Functions inherited from KexiTableEdit
 KexiTableEdit (KexiTableViewColumn &column, TQWidget *parent=0)
virtual KexiDB::QueryColumnInfo * columnInfo () const
virtual void setColumnInfo (KexiDB::QueryColumnInfo *)
KexiTableViewColumn * column () const
KexiDB::Field * displayedField () const
virtual TQWidget * widget ()
virtual void hideWidget ()
virtual void showWidget ()
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 handleDoubleClick ()
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 bool isReadOnly () const
virtual void moveCursorToEnd ()
virtual void moveCursorToStart ()
virtual void selectAll ()
bool hasFocusableWidget () const
virtual void clickedOnContents ()
bool acceptEditorAfterDeleteContents () const
virtual void setFocus ()
bool cursorAtNewRow ()
void setParentDataItemInterface (KexiDataItemInterface *parentDataItemInterface)
KexiDataItemInterface * parentInterface () const
Public Member Functions inherited from KexiComboBoxBase
virtual tristate valueChangedInternal ()
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
void createPopup (bool show)
void showPopup ()
virtual void slotRowAccepted (KexiTableItem *item, int row)
virtual void slotItemSelected (KexiTableItem *)
void slotInternalEditorValueChanged (const TQVariant &v)

Protected Slots

void slotButtonClicked ()
void slotRowAccepted (KexiTableItem *item, int row)
void slotItemSelected (KexiTableItem *item)
void slotInternalEditorValueChanged (const TQVariant &v)
void slotLineEditTextChanged (const TQString &s)
void slotPopupHidden ()
Protected Slots inherited from KexiInputTableEdit
void setRestrictedCompletion ()
void completed (const TQString &)

Protected Member Functions

void updateFocus (const TQRect &r)
virtual bool eventFilter (TQObject *o, TQEvent *e)
virtual TQWidget * internalEditor () const
virtual void moveCursorToEndInInternalEditor ()
virtual void selectAllInInternalEditor ()
virtual void setValueInInternalEditor (const TQVariant &value)
virtual TQVariant valueFromInternalEditor ()
virtual void editRequested ()
virtual void acceptRequested ()
virtual TQPoint mapFromParentToGlobal (const TQPoint &pos) const
virtual int popupWidthHint () const
virtual void updateButton ()
virtual KexiComboBoxPopup * popup () const
virtual void setPopup (KexiComboBoxPopup *popup)
Protected Member Functions inherited from KexiInputTableEdit
void showHintButton ()
void init ()
virtual void paintEvent (TQPaintEvent *e)
Protected Member Functions inherited from KexiTableEdit
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 Member Functions inherited from KexiComboBoxBase
KexiTableItem * selectItemForEnteredValueInLookupTable (const TQVariant &v)
TQString valueForString (const TQString &str, int *row, uint lookInColumn, uint returnFromColumn, bool allowNulls=false)
void setValueOrTextInInternalEditor (const TQVariant &value)
KexiDB::LookupFieldSchema * lookupFieldSchema () const
int rowToHighlightForLookupTable () const
virtual TQVariant visibleValueForLookupField ()
void updateTextForHighlightedRow ()
bool handleKeyPressForPopup (TQKeyEvent *ke)
void acceptPopupSelection ()
void undoChanges ()

Protected Attributes

Private * d
Protected Attributes inherited from KexiInputTableEdit
KexiTextFormatter m_textFormatter
bool m_calculatedCell
TQString m_decsym
TQString m_origText
KLineEdit * m_lineedit
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
Protected Attributes inherited from KexiComboBoxBase
TQVariant m_visibleValue
TQVariant m_userEnteredValue
bool m_internalEditorValueChanged: 1
bool m_slotInternalEditorValueChanged_enabled: 1
bool m_setValueOrTextInInternalEditor_enabled: 1
bool m_mouseBtnPressedWhenPopupVisible: 1
bool m_insideCreatePopup: 1
bool m_updatePopupSelectionOnShow: 1
bool m_moveCursorToEndInInternalEditor_enabled: 1
bool m_selectAllInInternalEditor_enabled: 1
bool m_setValueInInternalEditor_enabled: 1
bool m_setVisibleValueOnSetValueInternal: 1

Additional Inherited Members

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

Detailed Description

Drop-down cell editor.

Definition at line 37 of file kexicomboboxtableedit.h.

Constructor & Destructor Documentation

◆ KexiComboBoxTableEdit()

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

Definition at line 64 of file kexicomboboxtableedit.cpp.

◆ ~KexiComboBoxTableEdit()

KexiComboBoxTableEdit::~KexiComboBoxTableEdit ( )
virtual

Definition at line 102 of file kexicomboboxtableedit.cpp.

Member Function Documentation

◆ acceptRequested()

virtual void KexiComboBoxTableEdit::acceptRequested ( )
inlineprotectedvirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 147 of file kexicomboboxtableedit.h.

◆ clear()

void KexiComboBoxTableEdit::clear ( )
virtual

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

Reimplemented from KexiInputTableEdit.

Definition at line 195 of file kexicomboboxtableedit.cpp.

◆ column()

virtual KexiTableViewColumn * KexiComboBoxTableEdit::column ( ) const
inlinevirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 47 of file kexicomboboxtableedit.h.

◆ createInternalEditor()

void KexiComboBoxTableEdit::createInternalEditor ( KexiDB::QuerySchema & schema)
virtual

Created internal editor for this editor is needed. This method is only implemented in KexiComboBoxTableEdit since it's visible value differs from internal value, so a different KexiTableEdit object is used to displaying the data.

Todo
subtype?

todo set d->internalEditor visible and use it to enable data entering by hand

Reimplemented from KexiTableEdit.

Definition at line 107 of file kexicomboboxtableedit.cpp.

◆ editRequested()

virtual void KexiComboBoxTableEdit::editRequested ( )
inlineprotectedvirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 144 of file kexicomboboxtableedit.h.

◆ eventFilter()

bool KexiComboBoxTableEdit::eventFilter ( TQObject * o,
TQEvent * e )
protectedvirtual

Reimplemented from KexiTableEdit.

Definition at line 348 of file kexicomboboxtableedit.cpp.

◆ field()

virtual KexiDB::Field * KexiComboBoxTableEdit::field ( ) const
inlinevirtual

Implemented for KexiComboBoxBase.

Reimplemented from KexiTableEdit.

Definition at line 50 of file kexicomboboxtableedit.h.

◆ handleAction()

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

Reimplemented after KexiInputTableEdit.

Todo
does not work with BLOBs!

Reimplemented from KexiInputTableEdit.

Definition at line 427 of file kexicomboboxtableedit.cpp.

◆ handleCopyAction()

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

Reimplemented after KexiInputTableEdit. For a special case (combo box), visibleValue can be provided, so it can be copied to the clipboard instead of unreadable value.

Todo
does not work with BLOBs!

Reimplemented from KexiInputTableEdit.

Definition at line 420 of file kexicomboboxtableedit.cpp.

◆ handleKeyPress()

bool KexiComboBoxTableEdit::handleKeyPress ( TQKeyEvent * ke,
bool editorActive )
virtual

Used to handle key press events for the item.

Reimplemented from KexiTableEdit.

Definition at line 298 of file kexicomboboxtableedit.cpp.

◆ hide()

void KexiComboBoxTableEdit::hide ( )
virtual

Reimplemented from KexiComboBoxBase.

Definition at line 283 of file kexicomboboxtableedit.cpp.

◆ hideFocus()

void KexiComboBoxTableEdit::hideFocus ( )
virtual

Hides additional elements that are needed for indicating that the current cell is selected. For reimplementation. By default does nothing.

Reimplemented from KexiDataItemInterface.

Definition at line 180 of file kexicomboboxtableedit.cpp.

◆ internalEditor()

TQWidget * KexiComboBoxTableEdit::internalEditor ( ) const
protectedvirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 367 of file kexicomboboxtableedit.cpp.

◆ mapFromParentToGlobal()

TQPoint KexiComboBoxTableEdit::mapFromParentToGlobal ( const TQPoint & pos) const
protectedvirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 407 of file kexicomboboxtableedit.cpp.

◆ moveCursorToEnd

void KexiComboBoxTableEdit::moveCursorToEnd ( )
virtualslot

Implemented for KexiDataItemInterface.

mark

Definition at line 382 of file kexicomboboxtableedit.cpp.

◆ moveCursorToEndInInternalEditor()

void KexiComboBoxTableEdit::moveCursorToEndInInternalEditor ( )
protectedvirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 372 of file kexicomboboxtableedit.cpp.

◆ moveCursorToStart

void KexiComboBoxTableEdit::moveCursorToStart ( )
virtualslot

Implemented for KexiDataItemInterface.

mark

Definition at line 387 of file kexicomboboxtableedit.cpp.

◆ origValue()

virtual TQVariant KexiComboBoxTableEdit::origValue ( ) const
inlinevirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 53 of file kexicomboboxtableedit.h.

◆ paintFocusBorders()

void KexiComboBoxTableEdit::paintFocusBorders ( TQPainter * p,
TQVariant & cal,
int x,
int y,
int w,
int h )
virtual

Paints a border for the cell described by x, y, w, h on p painter. The cell's value is val (may be useful if you want to reimplement this method).

Reimplemented from KexiTableEdit.

Definition at line 209 of file kexicomboboxtableedit.cpp.

◆ popup()

KexiComboBoxPopup * KexiComboBoxTableEdit::popup ( ) const
protectedvirtual

Implements KexiComboBoxBase.

Definition at line 131 of file kexicomboboxtableedit.cpp.

◆ popupWidthHint()

int KexiComboBoxTableEdit::popupWidthHint ( ) const
protectedvirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 415 of file kexicomboboxtableedit.cpp.

◆ resize()

void KexiComboBoxTableEdit::resize ( int w,
int h )
virtual

Reimplemented: resizes a view().

Reimplemented from KexiTableEdit.

Definition at line 152 of file kexicomboboxtableedit.cpp.

◆ selectAll

void KexiComboBoxTableEdit::selectAll ( )
virtualslot

Implemented for KexiDataItemInterface.

Definition at line 392 of file kexicomboboxtableedit.cpp.

◆ selectAllInInternalEditor()

void KexiComboBoxTableEdit::selectAllInInternalEditor ( )
protectedvirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 377 of file kexicomboboxtableedit.cpp.

◆ setPopup()

void KexiComboBoxTableEdit::setPopup ( KexiComboBoxPopup * popup)
protectedvirtual

Implements KexiComboBoxBase.

Definition at line 136 of file kexicomboboxtableedit.cpp.

◆ setupContents()

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

Setups contents of the cell. As a special case, if there is lookup field schema defined, val already contains the visible value (usually the text) set by KexiTableView::paintcell(), so there is noo need to lookup the value in the combo box's popup.

Reimplemented from KexiTableEdit.

Definition at line 219 of file kexicomboboxtableedit.cpp.

◆ setValueInInternalEditor()

void KexiComboBoxTableEdit::setValueInInternalEditor ( const TQVariant & value)
protectedvirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 397 of file kexicomboboxtableedit.cpp.

◆ setValueInternal()

virtual void KexiComboBoxTableEdit::setValueInternal ( const TQVariant & add,
bool removeOld )
inlinevirtual

initializes this editor with add value

Reimplemented from KexiInputTableEdit.

Definition at line 55 of file kexicomboboxtableedit.h.

◆ show()

void KexiComboBoxTableEdit::show ( )
virtual

Definition at line 290 of file kexicomboboxtableedit.cpp.

◆ showFocus()

void KexiComboBoxTableEdit::showFocus ( const TQRect & r,
bool readOnly )
virtual

Displays additional elements that are needed for indicating that the current cell is selected. For example, combobox editor (KexiComboBoxTableEdit) moves and shows dropdown button. r is the rectangle for the cell. If readOnly is true, additional elements should be visually disabled, e.g. dropdown button of the combobox editor should be disabled. For reimplementation. By default does nothing.

Reimplemented from KexiDataItemInterface.

Definition at line 141 of file kexicomboboxtableedit.cpp.

◆ slotButtonClicked

void KexiComboBoxTableEdit::slotButtonClicked ( )
protectedslot

Definition at line 252 of file kexicomboboxtableedit.cpp.

◆ slotInternalEditorValueChanged

void KexiComboBoxTableEdit::slotInternalEditorValueChanged ( const TQVariant & v)
inlineprotectedslot

Definition at line 117 of file kexicomboboxtableedit.h.

◆ slotItemSelected

void KexiComboBoxTableEdit::slotItemSelected ( KexiTableItem * item)
inlineprotectedslot

Definition at line 116 of file kexicomboboxtableedit.h.

◆ slotLineEditTextChanged

void KexiComboBoxTableEdit::slotLineEditTextChanged ( const TQString & s)
protectedslot

Definition at line 322 of file kexicomboboxtableedit.cpp.

◆ slotPopupHidden

void KexiComboBoxTableEdit::slotPopupHidden ( )
protectedslot

Definition at line 272 of file kexicomboboxtableedit.cpp.

◆ slotRowAccepted

void KexiComboBoxTableEdit::slotRowAccepted ( KexiTableItem * item,
int row )
inlineprotectedslot

Definition at line 115 of file kexicomboboxtableedit.h.

◆ totalSize()

TQSize KexiComboBoxTableEdit::totalSize ( ) const
virtual
Returns
total size of this editor, including popup button.

Definition at line 362 of file kexicomboboxtableedit.cpp.

◆ updateButton()

void KexiComboBoxTableEdit::updateButton ( )
protectedvirtual

Implemented this to update button state.

Reimplemented from KexiComboBoxBase.

Definition at line 278 of file kexicomboboxtableedit.cpp.

◆ updateFocus()

void KexiComboBoxTableEdit::updateFocus ( const TQRect & r)
protected

internal

Definition at line 170 of file kexicomboboxtableedit.cpp.

◆ value()

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

Reimplemented from KexiInputTableEdit.

Definition at line 58 of file kexicomboboxtableedit.h.

◆ valueChanged()

bool KexiComboBoxTableEdit::valueChanged ( )
virtual
Returns
true if editor's value is changed (compared to original value)

Reimplemented from KexiInputTableEdit.

Definition at line 201 of file kexicomboboxtableedit.cpp.

◆ valueFromInternalEditor()

TQVariant KexiComboBoxTableEdit::valueFromInternalEditor ( )
protectedvirtual

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 402 of file kexicomboboxtableedit.cpp.

◆ visibleValue()

TQVariant KexiComboBoxTableEdit::visibleValue ( )
virtual
Returns
value that should be displayed for this item. Only used for items like combo box, where real value is an integer while displayed value is usually a text. For other item types this method should be empty.

Reimplemented from KexiDataItemInterface.

Definition at line 185 of file kexicomboboxtableedit.cpp.

◆ widthForValue()

int KexiComboBoxTableEdit::widthForValue ( TQVariant & val,
const TQFontMetrics & fm )
virtual
Returns
width of value. For the default implementation val is converted to a string and width of this string is returned.
Todo
ok?

Reimplemented from KexiTableEdit.

Definition at line 327 of file kexicomboboxtableedit.cpp.

Member Data Documentation

◆ d

Private* KexiComboBoxTableEdit::d
protected

Definition at line 162 of file kexicomboboxtableedit.h.


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