static int UpdateOnlyName(openfile* p) { int i; if (p->OnlyName != p->OnlyNameState) { WinMenuCheck(&p->Win,1,OPENFILE_ONLYNAME,p->OnlyName); p->OnlyNameState = p->OnlyName; if (p->OnlyName) { for (i=0;i<4;++i) p->DlgWidth[i] = GetColWidth(p,i); ShowWindow(p->WndList,SW_HIDE); SetColWidth(p,3,0); SetColWidth(p,2,0); SetColWidth(p,1,0); SetColWidth(p,0,300); ShowWindow(p->WndList,SW_SHOWNA); } else { ShowWindow(p->WndList,SW_HIDE); for (i=3;i>=0;--i) SetColWidth(p,i,max(15,p->DlgWidth[i])); ShowWindow(p->WndList,SW_SHOWNA); } } return ERR_NONE; }
///////////////////////////////////////////////////////////////////////////// // SetDate void CDropDayCug::SetDate( int nYear, int nMonth, int nDay ) { m_bIsUpdated = FALSE; SetNumberRows( 0 ); m_appDate.SetDate( nYear, nMonth, nDay ); if ( m_appDate.GetStatus() > 0 ) // date is invalid or null return; // generate the SQL query CString sqlStr = "SELECT Completed, Appointment, Date FROM Appointments " "WHERE Date = #" + m_appDate.Format() + "#;"; m_adoDatasource.OpenSQL( sqlStr, "Driver={Microsoft Access Driver (*.mdb)};Dbq=Appointments.mdb;Uid=;Pwd=;" ); // set added datasource to be default SetDefDataSource( m_adoDatasource.GetID()); // complete the datasource binding operation, let grid adjust // itself to reflect information found in the datasource SetGridUsingDataSource( m_adoDatasource.GetID()); SetSH_Width( 20 ); SetColWidth( 0, 30 ); SetColWidth( 1, 220 ); SetColWidth( 2, 0 ); AdjustComponentSizes(); }
void CLDisplayClassTable::FinishCreateSelf() { // Validate pointers. ValidateThis_(); // Do inherited configuration. OVTable::FinishCreateSelf(); // Set up default columns. Number of columns depends on whether // class IDs are significant. VETypeList* typeList = VETypeList::GetTypeList(); ValidateObject_(typeList); if (typeList->GetClassIDsSignificant()) { InsertCols(2, 0, nil, 0, false); SetColWidth(mFrameSize.width - 40, 1, 1); SetColWidth(40, 2, 2); } else { InsertCols(1, 0, nil, 0, false); SetColWidth(mFrameSize.width, 1, 1); } }
void FitParmsTable::Append ( const JCharacter* col1, const JCharacter* col2 ) { const JFontManager* fm = GetFontManager(); JSize lineHeight = fm->GetDefaultFont().GetLineHeight(); AppendRows(1, lineHeight + 2); JString* str = jnew JString(col1); itsCol1->Append(str); JSize col1Width = GetColWidth(1); JSize strWidth = fm->GetDefaultFont().GetStringWidth(*str); if (strWidth + 10 > col1Width) { SetColWidth(1, strWidth + 10); } str = jnew JString(col2); itsCol2->Append(str); JSize col2Width = GetColWidth(2); strWidth = fm->GetDefaultFont().GetStringWidth(*str); if (strWidth + 10 > col2Width) { SetColWidth(2, strWidth + 10); } TableRefresh(); }
void JXTreeListWidget::AdjustColWidths() { if (itsAdjustToTreeTask != NULL) { return; } const JSize colCount = GetColCount(); if (itsMinColWidths->GetElementCount() != colCount) { NeedsAdjustToTree(); return; } for (JIndex i=1; i<=colCount; i++) { SetColWidth(i, itsMinColWidths->GetElement(i)); } if (ColIndexValid(itsElasticColIndex)) { const JCoordinate minReqWidth = itsMinColWidths->GetElement(itsElasticColIndex); if (minReqWidth > 0) { const JCoordinate availWidth = GetApertureWidth() - (GetBoundsWidth() - GetColWidth(itsElasticColIndex)); SetColWidth(itsElasticColIndex, JMax(minReqWidth, availWidth)); } } }
void FitParmsTable::Clear() { itsCol1->DeleteAll(); itsCol2->DeleteAll(); RemoveAllRows(); SetColWidth(1, kDefColWidth); SetColWidth(2, kDefColWidth); TableRefresh(); }
SaveFileListBox() : CUIListBox ( GG::X0, GG::Y0, GG::X1, GG::Y1 ) { SetNumCols ( 5 ); SetColWidth ( 0, GG::X0 ); SetColWidth ( 1, GG::X0 ); SetColWidth ( 2, GG::X0 ); SetColWidth ( 3, GG::X0 ); SetColWidth ( 4, GG::X0 ); LockColWidths(); }
void CLogSpreadSheet::InitColumnWidth() { SetColWidth(colLogID,5); SetColWidth(colWriter,10); SetColWidth(colBigGroup,10); SetColWidth(colMarket,10); SetColWidth(colTask,10); SetColWidth(colManager,10); SetColWidth(colRequest,30); SetColWidth(colResult,30); SetColWidth(colComment,20); SetColWidth(colLogDate,10); }
THXVarTable::THXVarTable ( THXVarList* varList, JXTextMenu* fontMenu, JXScrollbarSet* scrollbarSet, JXContainer* enclosure, const HSizingOption hSizing, const VSizingOption vSizing, const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h ) : JXEditTable(1,1, scrollbarSet, enclosure, hSizing,vSizing, x,y, w,h) { const JSize rowHeight = 2*kVMarginWidth + (GetFontManager())->GetLineHeight(JGetDefaultFontName(), kJDefaultFontSize, JFontStyle()); SetDefaultRowHeight(rowHeight); itsVarList = varList; itsTextInput = NULL; itsFontMenu = fontMenu; AppendCols(2); // name, function const JSize count = itsVarList->GetElementCount() - THXVarList::kUserFnOffset; AppendRows(count); FitToEnclosure(); // make sure SetColWidth() won't fail ListenTo(this); // adjust fn col width SetColWidth(kNameColumn, GetApertureWidth()/3); // kFnColumn width set automatically }
CBMacroTable::CBMacroTable ( CBEditMacroDialog* dialog, JXTextButton* addRowButton, JXTextButton* removeRowButton, JXTextButton* loadButton, JXTextButton* saveButton, JXScrollbarSet* scrollbarSet, JXContainer* enclosure, const HSizingOption hSizing, const VSizingOption vSizing, const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h ) : CBKeyScriptTableBase(dialog, addRowButton, removeRowButton, scrollbarSet, enclosure, hSizing,vSizing, x,y, w,h) { itsLoadButton = loadButton; ListenTo(itsLoadButton); itsSaveButton = saveButton; ListenTo(itsSaveButton); itsCSF = new CBListCSF(JGetString(kReplaceListID), JGetString(kAppendToListID)); assert( itsCSF != NULL ); SetColWidth(kMacroColumn, 60); // script column set automatically }
void JXColHeaderWidget::Receive ( JBroadcaster* sender, const Message& message ) { // scrollbar moved if (sender == const_cast<JXScrollbar*>(itsHScrollbar) && message.Is(JXScrollbar::kScrolled)) { ScrollTo(itsHScrollbar->GetValue(), 0); } // columns changed else if (sender == itsTable && message.Is(JTable::kColWidthChanged)) { const JTable::ColWidthChanged* info = dynamic_cast(const JTable::ColWidthChanged*, &message); assert( info != NULL ); SetColWidth(info->GetIndex(), info->GetNewColWidth()); } else if (sender == itsTable && message.Is(JTable::kAllColWidthsChanged))
//////////////////////////////////////////////////////////// // QueueListBox //////////////////////////////////////////////////////////// QueueListBox::QueueListBox(const std::string& drop_type_str, const std::string& prompt_str) : CUIListBox(), m_drop_point(end()), m_show_drop_point(false), m_order_issuing_enabled(true), m_showing_prompt(false), m_prompt_str(prompt_str) { if (!drop_type_str.empty()) AllowDropType(drop_type_str); GG::Connect(BeforeInsertSignal, &QueueListBox::EnsurePromptHiddenSlot, this); GG::Connect(AfterEraseSignal, &QueueListBox::ShowPromptConditionallySlot, this); GG::Connect(ClearedSignal, &QueueListBox::ShowPromptSlot, this); GG::Connect(GG::ListBox::RightClickedSignal, &QueueListBox::ItemRightClicked, this); // preinitialize listbox/row column widths, because what // ListBox::Insert does on default is not suitable for this case SetNumCols(1); SetColWidth(0, GG::X0); LockColWidths(); NormalizeRowsOnInsert(false); ShowPromptSlot(); }
BOOL CTWenUGCtrlEx::CreateTable(CWnd *pcParent, CRect rect) { if(!CreateGrid(WS_CHILD|WS_VISIBLE,rect, pcParent, 1234)) return FALSE; if(!m_bDislplayFirstColumn) SetColWidth(-1, 0); return TRUE; }
PlayerListBox(void) : CUIListBox() { // preinitialize listbox/row column widths, because what // ListBox::Insert does on default is not suitable for this case SetNumCols(1); SetColWidth(0, GG::X0); LockColWidths(); }
void PIInspectorTable::FinishCreateSelf() { // Validate pointers. ValidateThis_(); // Do inherited initialization. OVTable::FinishCreateSelf(); // Set up default column widths. InsertCols(2, 0, nil, 0, false); SetColWidth(130, 1, 1); SetColWidth(150, 2, 2); // Find inspected object caption. LWindow* window = LWindow::FetchWindowObject(GetWindowFromPort(GetMacPort())); ValidateObject_(window); mInspectedObjectCaption = dynamic_cast<LStaticText*>(window->FindPaneByID(Pane_InspectedObject)); if (mInspectedObjectCaption != nil) ValidateObject_(mInspectedObjectCaption); // Find detach selection button. mDetachPIButton = (dynamic_cast<LBevelButton*>(window->FindPaneByID('DTCH'))); if (mDetachPIButton != nil) { ValidateObject_(mDetachPIButton); mDetachPIButton->AddListener(this); } // Listen to the grow zone. LGrowZone* growZone = LGrowZone::GetGrowZone(); ThrowIfNil_(growZone); growZone->AddListener(this); }
void CBMacroSetTable::ApertureResized ( const JCoordinate dw, const JCoordinate dh ) { JXStringTable::ApertureResized(dw,dh); SetColWidth(1, GetApertureWidth()); }
void JXRowHeaderWidget::ApertureResized ( const JCoordinate dw, const JCoordinate dh ) { JXEditTable::ApertureResized(dw,dh); SetColWidth(1, GetApertureWidth()); }
BOOL CTWenUGCtrlEx::SetTitle(int nCol, CString cStrTitleName, int nColWidth, int nTitleNO) { if(nCol>=GetNumberCols()) return FALSE; QuickSetText(nCol, nTitleNO, cStrTitleName); QuickSetFont(nCol, nTitleNO, m_nFontID_Title); SetColWidth(nCol, nColWidth); return TRUE; }
void CTOutlineTable::FinishCreateSelf() { // Validate pointers. ValidateThis_(); // Let OVTable do its initialization. OVTable::FinishCreateSelf(); // Set up default columns. InsertCols(4, 0, nil, 0, false); SetColWidth(120, 1, 1); SetColWidth( 48, 2, 2); SetColWidth(144, 3, 3); SetColWidth(144, 4, 4); }
void THXVarTable::AdjustColWidths() { const JSize apWidth = GetApertureWidth(); JCoordinate lineWidth; JColorIndex color; GetColBorderInfo(&lineWidth, &color); const JSize usedWidth = GetColWidth(kNameColumn) + lineWidth; if (apWidth > usedWidth) { SetColWidth(kFnColumn, apWidth - usedWidth); } else { const JSize nameWidth = apWidth/3; SetColWidth(kNameColumn, nameWidth); SetColWidth(kFnColumn, apWidth - nameWidth - lineWidth); } }
void CMLineIndexTable::AdjustToText() { const JFontManager* fontMgr = GetFontManager(); JFont font = itsText->GetCurrentFont(); const JSize lineCount = itsText->IsEmpty() ? 0 : itsText->GetLineCount(); const JString lineCountStr = GetLongestLineText(lineCount); const JSize lineHeight = font.GetLineHeight(); const JSize lineNumberWidth = font.GetStringWidth(lineCountStr); SetColWidth(kBreakpointColumn, lineHeight); SetColWidth(kExecPointColumn, lineHeight); SetColWidth(kLineNumberColumn, lineNumberWidth + 2*kMarginWidth); SetAllRowHeights(lineHeight); const JSize origRowCount = GetRowCount(); if (origRowCount < lineCount) { AppendRows(lineCount - origRowCount, lineHeight); } else if (origRowCount > lineCount) { RemovePrevRows(origRowCount, origRowCount - lineCount); } const JCoordinate tableWidth = GetBoundsWidth(); const JCoordinate apWidth = GetApertureWidth(); if (tableWidth != apWidth) { AdjustSize(tableWidth-apWidth, 0); itsText->Place(GetFrameWidth(), 0); itsText->AdjustSize(apWidth-tableWidth, 0); } ScrollTo(0, itsVScrollbar->GetValue()); UpdateBreakpoints(); }
void JXFSBindingTable::UpdateColWidths() { JCoordinate borderWidth; JColorIndex color; GetColBorderInfo(&borderWidth, &color); JCoordinate w = GetApertureWidth(); for (JIndex i=1; i<=kColCount; i++) { if (i != kCommandColumn) { w -= GetColWidth(i) + borderWidth; } } w = JMax(w, kInitColWidth[ kCommandColumn-1 ]); SetColWidth(kCommandColumn, w); }
GPMProcessTreeList::GPMProcessTreeList ( GPMProcessList* list, JNamedTreeList* treeList, JXTEBase* fullCmdDisplay, JXScrollbarSet* scrollbarSet, JXContainer* enclosure, const HSizingOption hSizing, const VSizingOption vSizing, const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h ) : JXNamedTreeListWidget(treeList, scrollbarSet, enclosure, hSizing,vSizing, x,y, w,h), itsList(list), itsContextMenu(NULL), itsSelectedEntry(NULL), itsFullCmdDisplay(fullCmdDisplay), itsZombieImage(NULL) { AppendCols(GPMProcessList::kTreeCount - 2); SetColWidth(GPMProcessList::kTreeState, 20); SetColWidth(GPMProcessList::kTreePID, 50); SetColWidth(GPMProcessList::kTreeUser, 75); SetColWidth(GPMProcessList::kTreeNice, 40); SetColWidth(GPMProcessList::kTreeSize, 60); SetColWidth(GPMProcessList::kTreeCPU, 50); SetColWidth(GPMProcessList::kTreeMemory, 60); SetColWidth(GPMProcessList::kTreeTime, 60); itsZombieImage = jnew JXImage(GetDisplay(), jx_edit_clear); assert( itsZombieImage != NULL ); itsContextMenu = GPMProcessTable::CreateContextMenu(this); ListenTo(itsContextMenu); ListenTo(itsList); }
void CLayerTypeGrid::OnSetup() { #ifdef CELL_EDIT DWORD dwStyle = 0; if ( m_myCUGEdit.GetSafeHwnd()) m_myCUGEdit.DestroyWindow(); dwStyle |= WS_CHILD|WS_VISIBLE; // create the edit control with specified style m_myCUGEdit.Create( dwStyle, CRect(0,0,0,0), this, 320001/*somerandom_ID*/ ); m_myCUGEdit.SetAutoSize(TRUE); m_myCUGEdit.m_ctrl = this; #endif SetNumberCols(0); SetNumberRows(0); BestFit(0, GetNumberCols()-1, myUG_FIT_ALL_ROWS, UG_BESTFIT_TOPHEADINGS); SetColWidth(-1, 0); // get rid of "row heading" }
void GMFilterMBoxTable::AdjustColWidths() { const JSize apWidth = GetApertureWidth(); JCoordinate lineWidth; JColorIndex color; GetColBorderInfo(&lineWidth, &color); const JSize usedWidth = GetColWidth(kCopyColumn) + lineWidth; if (apWidth > usedWidth) { SetColWidth(kMBoxColumn, apWidth - usedWidth); } else { // I'll really need to adjust this relative to the size of the patterns. } }
void CLDisplayClassTable::ResizeFrameBy( SInt16 inWidthDelta, SInt16 inHeightDelta, Boolean inRefresh) { // Validate pointers. ValidateThis_(); // Resize the view. LView::ResizeFrameBy(inWidthDelta, inHeightDelta, inRefresh); // Stretch the class name column to fill space. if (inWidthDelta != 0) SetColWidth(GetColWidth(1) + inWidthDelta, 1, 1); }
void PIInspectorTable::ResizeFrameBy( SInt16 inWidthDelta, SInt16 inHeightDelta, Boolean inRefresh) { // Validate pointers. ValidateThis_(); // Resize the view. LView::ResizeFrameBy(inWidthDelta, inHeightDelta, inRefresh); // Stretch the value column to fill space. if (inWidthDelta != 0) SetColWidth(GetColWidth(2) + inWidthDelta, 2, 2); }
void GLFitParameterTable::AdjustColWidth ( const JSize availabeWidth ) { JCoordinate lineWidth; JColorIndex color; GetColBorderInfo(&lineWidth, &color); JSize usedWidth = 2 * GetColWidth(kFitColIndex) + 2 * lineWidth; if (itsHasStartValues) { usedWidth += GetColWidth(kStartColIndex) + lineWidth; } if (availabeWidth > usedWidth) { SetColWidth(kNameColIndex, availabeWidth - usedWidth); } }
void CBCommandTable::ReadGeometry ( istream& input ) { JFileVersion vers; input >> vers; if (vers <= kCurrentGeometryDataVersion) { JCoordinate w; input >> w; SetColWidth(kMenuTextColumn, w); input >> w; SetColWidth(kMenuShortcutColumn, w); input >> w; SetColWidth(kScriptNameColumn, w); input >> w; SetColWidth(kCommandColumn, w); input >> w; SetColWidth(kOptionsColumn, w); input >> w; SetColWidth(kPathColumn, w); }
void CRGXMainWndGrid::SetColumnWidths() { BOOL bOldLock = LockUpdate(); SetColWidth(0,0,15); SetColWidth(1,1,40); // Lainan numero SetColWidth(2,2, 140);// nimi SetColWidth(3,3, 59);// päiväys SetColWidth(4,4, 59);// eräpäivä SetColWidth(5,5,15); // tila SetColWidth(6,6,59); // Vakuusarvo SetColWidth(7,7,59); // Lainan määrä SetColWidth(8,8,90); // OdotusPv SetColWidth(9,9,70); // Viite# SetColWidth(10,10,0); // Korko% SetColWidth(11,11,30); // Kielto SetColWidth(12,12,0); // SäilVakMaksu SetColWidth(13,13,0); // Kuittimaksu SetColWidth(14,14,0); // YlimSäilMaksu SetColWidth(15,15,30); // Liitteet SetColWidth(16,16,40); // Huom SetColWidth(17,17,0); // Varasto //SetColWidth(18,18,20); // SetRowHeight(1,13,30); // Rivikork SetStyleRange(CGXRange(0,1), CGXStyle().SetValue("Laina")); SetStyleRange(CGXRange(0,2), CGXStyle().SetValue("LaNimi")); SetStyleRange(CGXRange(0,3), CGXStyle().SetValue("AlkuPv")); SetStyleRange(CGXRange(0,4), CGXStyle().SetValue("EräPv")); SetStyleRange(CGXRange(0,5), CGXStyle().SetValue("Tila")); SetStyleRange(CGXRange(0,6), CGXStyle().SetValue("VakArvo")); SetStyleRange(CGXRange(0,7), CGXStyle().SetValue("Laina")); SetStyleRange(CGXRange(0,8), CGXStyle().SetValue("OdotusPv")); SetStyleRange(CGXRange(0,9), CGXStyle().SetValue("Viite#")); SetStyleRange(CGXRange(0,10), CGXStyle().SetValue("Korko%")); SetStyleRange(CGXRange(0,11), CGXStyle().SetValue("Kielto")); SetStyleRange(CGXRange(0,12), CGXStyle().SetValue("Säilytysmaksu")); SetStyleRange(CGXRange(0,13), CGXStyle().SetValue("Kuittimaksu")); SetStyleRange(CGXRange(0,14), CGXStyle().SetValue("YlimSäilytysmaksu")); SetStyleRange(CGXRange(0,15), CGXStyle().SetValue("Liitteet")); SetStyleRange(CGXRange(0,16), CGXStyle().SetValue("Huom")); SetStyleRange(CGXRange(0,17), CGXStyle().SetValue("Varasto")); //SetStyleRange(CGXRange(0,17), CGXStyle().SetValue("")); //SetStyleRange(CGXRange(0,18), CGXStyle().SetValue("")); //SetStyleRange(CGXRange(0,19), CGXStyle().SetValue("")); /* SetStyleRange(CGXRange().SetCols(8), CGXStyle() .SetControl(GX_IDS_CTRL_DATETIME) ); */ LockUpdate(bOldLock); }