tablecontrol.h
来自「这是VCF框架的代码」· C头文件 代码 · 共 855 行 · 第 1/2 页
H
855 行
void setAllowSingleRowSelection( bool val ) { allowSingleRowSelection_ = val; } bool getAllowFixedColumnSelection() { return allowFixedColumnSelection_; } void setAllowFixedColumnSelection( bool val ) { allowFixedColumnSelection_ = val; } bool getAllowFixedRowSelection() { return allowFixedRowSelection_; } void setAllowFixedRowSelection( bool val ) { allowFixedRowSelection_ = val; } virtual void keyDown( KeyboardEvent* e ); void resizeColumnWidths(); void resizeRowHeights(); void resizeColumnRowDimensions(); /** * autosize the specified column's width to its text */ bool autoSizeColumn( int column, AutoSizeOption autoSizeStyle=asoDefault, bool resetScroll=true ); /** * autosize the specified row's heigth to its text */ bool autoSizeRow( int row, bool resetScroll=true); Color* getDefaultTableCellColor(); void setDefaultTableCellColor( Color* color ); Font* getDefaultTableCellFont(); void setDefaultTableCellFont( Font* font );protected: enum MouseState{ msNone = 0, msPrepareForEdit, msPrepareForDrag, msPrepareToSelect, msPrepareColResize, msColResizing, msPrepareRowResize, msRowResizing, msSelectAll, msSelectColumn, msSelectRow, msSelectCells }; Rect getBoundsForCell( const CellID& cell ); Rect getBoundsForItem( TableCellItem* item ); double getFixedColumnWidth(); double getFixedRowHeight(); void onTableModelChanged( TableModelEvent* event ); void onTableCellItemSelected( ItemEvent* event ); void onTableModelEmptied( ModelEvent* e ); void onEditingControlKeyPressed( KeyboardEvent* event ); void finishEditing(); void cancelEditing(); void onFocusLost( FocusEvent* e ); void onFinishEditing( Event* e ); CellID getCellIDFromPoint( const Point& pt, bool allowFixedCellCheck=true ); TableCellItem* getItem( const CellID& cell ); CellID setFocusedCell( const CellID& cell ); bool columnResizeAreaHitTest( const Point& pt ); bool rowResizeAreaHitTest( const Point& pt ); /** returns false if the cell is not visible, otherwise pt will be set to the top left coordinates of the item represented by the row/col of cell */ bool getCellOrigin( const CellID& cell, Point& pt ); CellID getTopLeftNonFixedCell( const bool& recalc=false ); CellRange getVisibleNonFixedCellRange( Rect* rect=NULL, bool forceRecalculation=false ); Point getClickedPoint( const CellID& cell, const Point& pt ); void clearSelectionRange(); void doSelection( const CellID& cell ); void selectAllCells(); void selectColumns( CellID currentCell, bool forceRedraw=false, bool selectCells=true ); void selectRows( CellID currentCell, bool forceRedraw=false, bool selectCells=true ); void selectCells( CellID currentCell, bool forceRedraw=false, bool selectCells=true ); void fixedRowClicked( CellID cell ); void fixedColumnClicked( CellID cell ); void recalcScrollBars(); void onVerticalScrolling( Event* e ); void onHorizontalScrolling( Event* e ); double getTotalRowHeight(); double getTotalColumnWidth(); void editCell( const CellID& cell, const Point& pt ); Rect getEditCellRect( const CellID& editCellID );protected: TableCellItem* selectedCellItem_; Control* currentEditingControl_; TableItemEditor* currentItemEditor_; bool autoResizeColumns_; bool allowColumnResizing_; bool allowRowResizing_; bool hiddenColumnUnhide_; bool hiddenRowUnhide_; bool listMode_; bool allowColumnHide_; bool allowRowHide_; bool enableSelection_; bool allowSingleColumnSelection_; bool allowSingleRowSelection_; bool allowFixedColumnSelection_; bool allowFixedRowSelection_; bool allowLiveResizing_; int resizeCaptureRange_; Point resizeDragPt_; Point lastMousePoint_; Point leftClickPoint_; CellID clickCell_; CellID selectionStartCell_; CellID currentCell_; CellID topLeftCell_; uint32 dragColumnWidth_; double totalRowHeight_; MouseState mouseState_; DrawGridLines drawGridLinesStyle_; AutoSizeOption autoSizeStyle_; uint32 defaultColumnWidth_; uint32 defaultRowHeight_; std::vector<uint32> columnWidths_; std::vector<uint32> rowHeights_; std::map<CellID,TableCellItem*> previouslySelectedCellMap_; Color* defaultCellColor_; Font* defaultCellFont_;};}; // namespace VCF/***CVS Log info*$Log$*Revision 1.4 2006/04/07 02:35:25 ddiego*initial checkin of merge from 0.6.9 dev branch.**Revision 1.3.2.3 2006/03/18 22:17:42 ddiego*removed par tag for doxygen comments as its not needed and*screws up the doc formatting.**Revision 1.3.2.2 2006/03/14 02:25:47 ddiego*large amounts of source docs updated.**Revision 1.3.2.1 2005/09/03 14:03:52 ddiego*added a package manager to support package info instances, and*fixed feature request 1278069 - Background color of the TableControl cells.**Revision 1.3 2005/07/09 23:14:55 ddiego*merging in changes from devmain-0-6-7 branch.**Revision 1.2.4.3 2005/03/01 18:28:07 marcelloptr*autosize members made public**Revision 1.2.4.2 2005/02/16 05:09:31 ddiego*bunch o bug fixes and enhancements to the property editor and treelist control.**Revision 1.2.4.1 2005/01/26 20:59:28 ddiego*some fixes to table control and to teh table item editor interface**Revision 1.2 2004/08/07 02:49:10 ddiego*merged in the devmain-0-6-5 branch to stable**Revision 1.1.2.3 2004/06/06 07:05:31 marcelloptr*changed macros, text reformatting, copyright sections**Revision 1.1.2.2 2004/04/29 03:43:14 marcelloptr*reformatting of source files: macros and csvlog and copyright sections**Revision 1.1.2.1 2004/04/28 00:28:19 ddiego*migration towards new directory structure**Revision 1.20.2.1 2004/04/26 21:58:21 marcelloptr*changes for dir reorganization: _VCF_MACRO_H__**Revision 1.20 2004/04/03 15:48:40 ddiego*Merged over code from the 0-6-3 branch.**Revision 1.19.2.15 2004/03/22 22:55:47 ddiego*minor table control change**Revision 1.19.2.14 2004/03/19 21:25:41 ddiego*just some minor noodlin**Revision 1.19.2.13 2004/03/19 04:18:53 ddiego*added more code to condition example, fixed some*minor stuff in the table control**Revision 1.19.2.12 2004/03/11 04:37:13 ddiego*minor changes to table control.**Revision 1.19.2.11 2004/03/10 04:27:31 ddiego*blah**Revision 1.19.2.10 2004/03/08 04:41:07 ddiego*minor changes to DocumentManager - allow the use of*Actions so that other UI elements can be added besides menu*items (like Toolbar items)**Revision 1.19.2.9 2004/03/03 05:02:53 ddiego*Table editing is working again. The only major missing piece*as compared to the CGridCtrl, is drag/drop support.**Revision 1.19.2.8 2004/03/01 05:58:54 ddiego*and even MORE updates to the TableControl. Most of the core functionality from Chris Maunder's CGridCtrl has been migrated over, and is functional. Item editing and item dragging is still not done. Had to make a minor change to the AbstractScroallable class to allow it have vertical and/or horizontal delegate's set in order to notify them of position changes. This was needed by the TableControl to properly update the top left non fixed cell calculation. The performance is kind of slow ( :) ) in debug mode, but quite snappy in release.**Revision 1.19.2.7 2004/02/26 05:10:38 ddiego*more table control work**Revision 1.19.2.6 2004/02/24 01:42:43 ddiego*initial OSX ApplicationKit port checkin**Revision 1.19.2.5 2004/02/19 04:52:34 ddiego*more progress made with TableControl**Revision 1.19.2.4 2004/02/15 20:24:01 ddiego*intial Locales implementation is now checked in. This adds several new classes, namely:*The LocalePeer, which is the OS generic peer for interfacing with teh OS for lcoale support*The Locale class which provides locale support for the vcf*The Win32LocalePeer which provides a basic Win32 implementation for locale support*The UnicodeString class, which is a near identical class to the std::string class and provides a wrapper around a std::basic_string<wchar_t>. This also adds support for translating to and from ansi strings, and supporting text encoding via a TextEncoder class.*The TextCodec class which allows for custom text codec for encoding or decoding text.*The MessageLoader class which is used to provide localized string translation*The StringsMessageLoader which provides a basic implementation of string loading and translation that is compatible with Apples .strings resource files.**Revision 1.19.2.3 2004/02/12 21:59:36 marcelloptr*minor fixes related to TabModel**Revision 1.19.2.2 2004/02/02 04:38:36 ddiego*more table codin'**Revision 1.19.2.1 2004/01/30 22:08:08 ddiego*more fixes to the table model and table control**Revision 1.19 2003/12/18 05:15:57 ddiego*merge from devmain-0-6-2 branch into the stable branch**Revision 1.18.2.4 2003/09/12 00:09:32 ddiego*added better tabbing behaviour - fixed an earlier bug.*Code is easier to understand and it simplified the implementation*a bit as well*Moved around the RTTI definitions for various Appkit classes to a*single inline and stripped them from the various class headers**Revision 1.18.2.3 2003/09/06 19:45:45 ddiego*changes to ensure that the destroy() is properly called.*Destructors were moved back to pbulic scope in case that was causing a bug.*Moving them all(all teh component derived classes) to private scope causes*a complete failure in hte VC6 compiler. Alas...*So destructors are present, and modal dialogs can still be created on the*stack, but almost any other component should be created on the heap, and*gotten rid of via free() NOT using operator delete directly.*also moved the vcs info to the end of the file for some of the headers*This will be an ongoing process.**Revision 1.18.2.2 2003/09/05 21:03:39 ddiego*moved the various control destructor's to protected scope*migrated code into destroy() overridden methods*----------------------------------------------------------------------**Revision 1.18.2.1 2003/08/18 19:52:32 ddiego*changed the Container from being a class you derive from to a separate*intance that is created and assigned dynamically to any Control.**Revision 1.18 2003/08/09 02:56:42 ddiego*merge over from the devmain-0-6-1 branch*Changes*Features:*-Added additional implementation to better support the MVC architecture in*the VCF**-Added a Document/View architecure that is similar to MFC's or NextSteps's*Doc/View architectures**-Integrated the Anti Grain Graphics library into the GraphicsKit. There is*now basic support for it in terms of drawing vector shapes*(fills and strokes). Image support will come in the next release**-Added several documented graphics tutorials**Bugfixes:**[ 775744 ] wrong buttons on a dialog*[ 585239 ] Painting weirdness in a modal dialog ?*[ 585238 ] Modal dialog which makes a modal Dialog*[ 509004 ] Opening a modal Dialog causes flicker*[ 524878 ] onDropped not called for MLTcontrol**Plus an issue with some focus and getting the right popup window to activate*has also been fixed**Revision 1.17.2.1 2003/06/28 04:43:20 ddiego*cleaned up the vcf/include/events directory and got rid of files, moving*some of the various event handler template classes into the same header*that the event handler's event is associated with*also made some changes to properly take advantage of a Control's View, if it*is set.**Revision 1.17 2003/05/17 20:37:04 ddiego*this is the checkin for the 0.6.1 release - represents the merge over from*the devmain-0-6-0 branch plus a few minor bug fixes**Revision 1.16.2.1 2003/03/12 03:09:45 ddiego*switched all member variable that used the "m_"<name> prefix to* <name>"_" suffix nameing standard.*Also changed all vcf builder files to accomadate this.*Changes were made to the Stream classes to NOT multiple inheritance and to*be a little more correct. Changes include breaking the FileStream into two*distinct classes, one for input and one for output.**Revision 1.16 2003/02/26 04:30:38 ddiego*merge of code in the devmain-0-5-9 branch into the current tree.*most additions are in the area of the current linux port, but the major*addition to this release is the addition of a Condition class (currently*still under development) and the change over to using the Delegate class*exclusively from the older event handler macros.**Revision 1.15.2.2 2002/12/27 23:04:32 marcelloptr*Improved macros for automatic import/export of libraries. - Warning fixes. - Other Minor Changes.**Revision 1.15.2.1 2002/12/25 22:38:00 ddiego*more stupid fixes to get rid of the damn gcc no newline warning...grrr...**Revision 1.15 2002/11/18 00:46:08 ddiego*this is the merge over of all the bug fixes and features (mostly*VCF Builder stuff) from the devmain-0-5-8 branch**Revision 1.14.4.1 2002/11/09 05:17:10 ddiego*changes are for fixing bug [ 634798 ] Property pane not scrolling.*ignore the inclusion of TreeListControl.cpp in this checkin.**Revision 1.14 2002/09/12 03:26:03 ddiego*merged over the changes from the devmain-0-5-5b branch**Revision 1.13.6.2 2002/09/10 04:07:48 ddiego*misc fixes plus now posting the TableControl::finishEditing as a event**Revision 1.13.6.1 2002/09/06 05:24:33 ddiego*fixed bug in TableControl where it does not proeprly finished the ItemEditor*correctly on loss of focus for the editor's control**Revision 1.13 2002/05/09 03:10:42 ddiego*merged over code from development branch devmain-0-5-1a into the main CVS trunk**Revision 1.12.4.1 2002/04/27 15:42:56 ddiego*removed ApplicationKit.h and optimized header includes as*well as adding better include guard support**Revision 1.12 2002/01/24 01:46:47 ddiego*added a cvs "log" comment to the top of all files in vcf/src and vcf/include*to facilitate change tracking**/#endif // _VCF_TABLECONTROL_H__
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?