Tables

  1 //Tables.cpp
  2
  3 /*
  4 Copyright 2000-2004 The VCF Project.
  5 Please see License.txt in the top level directory
  6 where you installed the VCF.
  7 */
  8
  9
 10 #include "vcf/ApplicationKit/ApplicationKit.h"
 11 #include "vcf/ApplicationKit/ControlsKit.h"
 12
 13
 14 using namespace VCF;
 15
 16
 17
 18 class TablesWindow : public Window {
 19 public:
 20     TablesWindow() {
 21         setCaption( "Tables" );
 22
 23
 24         TableControl* table = new TableControl();
 25
 26         add( table, AlignClient );
 27
 28         TableModel* model = table->getTableModel();
 29
 30         model->empty();
 31
 32         table->setDefaultTableCellFont( &Font("Tahoma") );
 33
 34         model->addColumns( 12 );
 35         model->addRows(130);
 36         model->setFixedRowsCount( 1 );
 37         model->setFixedColumnsCount( 1 );
 38
 39         for (int y=0;y<model->getRowCount();y++ ){
 40             for ( int x=0;x<model->getColumnCount();x++ ) {
 41                 if ( table->getItem( y, x )->isFixed() ) {
 42                     table->getItem( y, x )->setCaption( Format( "Cell [%d,%d]" ) % y % x );
 43                 }
 44                 else {
 45                     model->setValue( y, x, 1.0 * x * y );
 46                 }
 47
 48                 if ( y == 10 && x == 5 ) {
 49                     Font font = *table->getDefaultTableCellFont();
 50                     font.setName( "Times New Roman" );
 51                     font.setPointSize( 12.6 );
 52                     font.setBold( true );
 53                     table->getItem( y, x )->setFont( &font );
 54                     table->getItem( y, x )->setColor( Color::getColor("yellow") );
 55                 }
 56             }
 57         }
 58
 59
 60
 61         /*******************************************
 62         ---------------------------------------------
 63         |    Hey there!!!! Yes you! The following line
 64         |    turns *OFF* row selection!! :)
 65         ---------------------------------------------
 66         ********************************************/
 67         table->setAllowFixedRowSelection( false );
 68
 69     }
 70
 71     virtual ~TablesWindow(){};
 72
 73 };
 74
 75
 76
 77
 78 class TablesApplication : public Application {
 79 public:
 80
 81     TablesApplication( int argc, char** argv ) : Application(argc, argv) {
 82
 83     }
 84
 85     virtual bool initRunningApplication(){
 86         bool result = Application::initRunningApplication();
 87
 88         Window* mainWindow = new TablesWindow();
 89         setMainWindow(mainWindow);
 90         mainWindow->setBounds( &Rect( 100.0, 100.0, 500.0, 500.0 ) );
 91         mainWindow->show();
 92
 93         return result;
 94     }
 95
 96 };
 97
 98
 99
100 int main(int argc, char *argv[])
101 {
102     return ApplicationKitMain<TablesApplication>(argc,argv);
103 }
104
105
106 /**
107 $Id: Tables.cpp 3420 2008-03-31 04:02:58Z ddiego $
108 */
时间: 2024-11-05 22:00:03

Tables的相关文章

Replicate Partitioned Tables and Indexes

在初始化subscriber时,Replication能够将分区table 和 分区index的Partition function 和 Partition schema 复制到 subscriber中,这样,table 和 Index 以相同的Partition schema创建.但是,replication 不会将 Partition function 和 Partition schema的更新同步到subscriber,即只在初始subscriber时,复制一次 Partition fun

mysql启动报错:Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

mysql在首次启动的时候可能会报错:Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist 这时候可以执行脚本 mysql_install_db –user=mysql –ldata=数据存放的路径

uva 1385 - Billing Tables(字典树)

题目链接:uva 1385 - Billing Tables 题目大意:给定n个电话前缀,每个前缀是一个区域的前缀,现在要生成一个新的电话单,即对于每个电话号码,从旧的电话单上从前向后遍历,如果出现前缀匹配,则该电话号码对应的即为当前的区号,要求生成的新电话单尽量小. 解题思路:用dfs建立字典树,在区间范围内的点对应均为对应的区号,注意如果70.71.72....79都为SB的话,那么可以合并成7,并且对应区号为SB. 注意合并的条件为区号相同即可,并不是说对应旧电话单匹配位置相同. 注意这组

MySql: show databases/tables use database desc table

1. show databases mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema || test |+--------------------+4 rows in set (0.00 sec) 2. use database_name mysql> use testDatabase

People Tools catalog tables.

Projects PSPROJECTDEFN — Project header table PSPROJECTITEM — Definitions in the project Fields PSDBFIELD — Fields in the system PSXLATITEM — Translate Values Records PSRECDEFN — Record header table (record types) PSRECFIELD — Fields in the record (s

对于显示指定LOCK TABLES的并行插入问题(从其它表)

文档: If you acquire a table lock explicitly with LOCK TABLES, you can request a READ LOCAL lock ratherthan a READ lock to enable other sessions to perform concurrent inserts while you have the tablelocked.To perform many INSERT and SELECT operations o

启动mysql问题Can&#39;t open and lock privilege tables: Table &#39;mysql.host&#39; doesn&#39;t exist

启动mysql出现问题 /etc/init.d/mysqld start MySQL server PID file could not be found![FAILED] Starting MySQL......................................The server quit without updating PID file (/data/mysql/mysql_3306/data/mysql.pid).[FAILED] 查看错误日志 150619 15:57:

安装concrete时提示“...database does not support InnoDB database tables...&quot;如何解决

安装很多系统时,经常有有提示: "...database does not support InnoDB database tables..." 解决办法: 找到MySQL的配置文件: windows下是my.ini linux下/etc/my.cnf 找到如下的代码: skip-innodb 修改为如下: #skip-innodb

poj1083 Moving Tables

Moving Tables Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 26782   Accepted: 8962 Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200

1502021733-hdu-How Many Tables

How Many Tables Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 14   Accepted Submission(s) : 12 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description Today is Ignatius' bi