[Igarden-commit] CommonSource/YAAFExtensions RGTableView.h, 1.16.2.13, 1.16.2.14 RGTableView.cpp, 1
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2008-04-09 03:03:17
|
Update of /cvsroot/igarden/CommonSource/YAAFExtensions In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15098/YAAFExtensions Modified Files: Tag: Release_branch_v1 RGTableView.h RGTableView.cpp Log Message: Adjust existing columns widths when font is changed Index: RGTableView.cpp =================================================================== RCS file: /cvsroot/igarden/CommonSource/YAAFExtensions/RGTableView.cpp,v retrieving revision 1.28.2.33 retrieving revision 1.28.2.34 diff -C2 -d -r1.28.2.33 -r1.28.2.34 *** RGTableView.cpp 8 Apr 2008 22:23:11 -0000 1.28.2.33 --- RGTableView.cpp 9 Apr 2008 03:03:17 -0000 1.28.2.34 *************** *** 515,521 **** void RGTableView::SetFont(char *name, long fontSize) { ! _font->SetFontName(name); ! _font->SetFontSize(fontSize); ! InvalView(); } --- 515,563 ---- void RGTableView::SetFont(char *name, long fontSize) { ! char oldName[256]; ! short oldSize; ! long origin, width, n, count; ! RGTableCell *cell; ! ! _font->GetFontName(oldName); ! oldSize = _font->GetFontSize(); ! ! if((oldSize != fontSize) || (strcmp(name, oldName) != 0)) ! { ! _font->SetFontName(name); ! _font->SetFontSize(fontSize); ! ! count = _colArray.Length(); ! for(n = 0, origin = 0; n < count; n++) ! { ! cell = (*(_colArray[n]->factory))(&_data, NULL, NULL, this); ! cell->SetEmpty(_colArray[n]->cellType); ! switch(_colArray[n]->cellType) ! { ! case KTypeMenu: ! cell->SetMenu(_colArray[n]->menuRef, 0); ! break; ! case KTypeBitfieldMenu: ! cell->SetBitfieldMenu(_colArray[n]->menuRef, 0); ! break; ! case KTypeBitfieldRangeMenu: ! cell->SetBitfieldRangeMenu(_colArray[n]->menuRef, 0); ! break; ! default: ! break; ! } ! width = cell->MinColumnWidth(); ! if(width < _colArray[n]->initialWidth) ! width = _colArray[n]->initialWidth; ! ! _colArray[n]->origin = origin; ! _colArray[n]->width = width; ! ! delete cell; ! origin += width; ! } ! ! InvalView(); ! } } *************** *** 820,824 **** { struct ColRecord *info; ! short n, count, origin, minWidth; RGTableCell *cell; --- 862,866 ---- { struct ColRecord *info; ! short n, count, origin, minWidth, initialWidth; RGTableCell *cell; *************** *** 836,839 **** --- 878,882 ---- cell->SetBitfieldRangeMenu(menuRef, 0); + initialWidth = width; minWidth = cell->MinColumnWidth(); if(width < minWidth) *************** *** 848,855 **** --- 891,901 ---- info->resize = false; info->origin = origin; + info->initialWidth = initialWidth; info->width = width; info->visible = true; info->ordered = false; info->factory = factory; + info->cellType = cellType; + info->menuRef = menuRef; info->client = client; if(client != NULL) Index: RGTableView.h =================================================================== RCS file: /cvsroot/igarden/CommonSource/YAAFExtensions/RGTableView.h,v retrieving revision 1.16.2.13 retrieving revision 1.16.2.14 diff -C2 -d -r1.16.2.13 -r1.16.2.14 *** RGTableView.h 30 Mar 2008 21:57:33 -0000 1.16.2.13 --- RGTableView.h 9 Apr 2008 03:03:12 -0000 1.16.2.14 *************** *** 99,106 **** --- 99,109 ---- bool resize; short origin; + short initialWidth; short width; bool visible; bool ordered; cellFactory_t factory; + short cellType; + uint32 menuRef; ClientColumn *client; }; |