Search the Community
Showing results for tags 'width'.
-
Save and restore the order and width of columns in UnidbGrid These functions can be used in forms If the form contains a grid, just pass the grid and leave the second parameter empty If the form contains multiple grids, you can also pass a second word in the second parameter in addition to the grid Virtual table (kind of memory tables) tables are used for saving and retrieving, but you can use JSON or XML Procedure TDMT.SaveGrids_SaveGridLayout(Grid: TUniDBGrid; Const KeyAlt: String = ''); Var i: Integer; vt: TVirtualTable; Begin If Not Assigned(Grid) Then Exit; Grid.Refresh; vt := VTGridLayouts; // حذف قبلی Try SaveGrids_DeleteGridLayout(Grid, KeyAlt); // ذخیره جدید For i := 0 To Grid.Columns.Count - 1 Do Begin vt.Insert; vt.FieldByName('GridKey') .AsString := Grid.Parent.Name + '_' + Grid.Name; vt.FieldByName('GridKeyAlt') .AsString := KeyAlt; vt.FieldByName('FieldName') .AsString := Grid.Columns[i].FieldName; vt.FieldByName('ColIndex') .AsInteger := Grid.Columns[i].Index; vt.FieldByName('ColWidth') .AsInteger := IfThen(Grid.Columns[i].Width>150,Grid.Columns[i].Width,150); vt.Post; End; Finally SaveGrids_SaveToFile; End; End; Procedure TDMT.SaveGrids_LoadGridLayout(Grid: TUniDBGrid; Const KeyAlt: String = ''); Var i: Integer; vt: TVirtualTable; EffectiveKey, FieldName: String; Begin If Not Assigned(Grid) Then Exit; vt := VTGridLayouts; EffectiveKey := IfThen(KeyAlt <> '', KeyAlt, Grid.Parent.Name + '_' + Grid.Name); vt.Filtered:=False; Vt.Filter:='(GridKeyAlt='+ QuotedStr(KeyAlt)+') Or (GridKey='+QuotedStr(Grid.Parent.Name + '_' + Grid.Name)+' And GridKeyAlt ='+ QuotedStr('')+')'; vt.Filtered:=True; For i := 0 To Grid.Columns.Count - 1 Do Begin FieldName := Grid.Columns[i].FieldName; vt.First; If Vt.Locate('FieldName',FieldName,[]) Then Begin Grid.Columns[i].Flex := 0; Grid.Columns[i].Index := vt.FieldByName('ColIndex').AsInteger; Grid.Columns[i].MinWidth := 100; Grid.Columns[i].Width := vt.FieldByName('ColWidth').AsInteger; End; End; End; Procedure TDMT.SaveGrids_DeleteGridLayout(Grid: TUniDBGrid; Const KeyAlt: String = ''); Var vt: TVirtualTable; Begin If Not Assigned(Grid) Then Exit; vt := VTGridLayouts; vt.Filtered := False; vt.Filter := '(GridKeyAlt=' + QuotedStr(KeyAlt) + ') Or (GridKey=' + QuotedStr(Grid.Parent.Name + '_' + Grid.Name) + ' And GridKeyAlt =' + QuotedStr('') + ')'; vt.Filtered := True; vt.First; While Not vt.IsEmpty Do vt.Delete; vt.Filtered := False; End; procedure TDMT.SaveGrids_SaveToFile; begin VTGridLayouts.SaveToFile(CurrentPath + '\GridLayouts.xml'); end; procedure TDMT.SaveGrids_LoadFromFile; begin if FileExists(CurrentPath + '\GridLayouts.xml') then VTGridLayouts.LoadFromFile(CurrentPath + '\GridLayouts.xml'); VTGridLayouts.Open; end;
- 7 replies
-
- 2
-
-
- unidbgrid
- virtualtable
- (and 4 more)
-
Currently I'm using this component (UniDbDateTimePicker) with the property "Kind" set to tUniDateTime to handle TimeStamps fields from my DB, but I'm having trouble to set the width correctly to make both sides rightly ajusted. As you guys can see, the left side has more than sufficient space while the right side doesn't have enough. If I try to increase the width the proportion stand the same and the spare space from the left side increase aswell making my layout look bad. Does anyone know how to set the width from both sides (Date and Time) separately?
- 2 replies
-
- componen
- configuration
-
(and 3 more)
Tagged with:
-
I have a stringgrid where the user can change the text font size of the cells. Is there a way of resizing the cell heights/widths so the cell text is always visible within the cells regardless of the font size selected?
-
- unistringgrid
- cell
-
(and 2 more)
Tagged with:
-
Hello In the MainForm I have a panel with 4 child panels (3 of them aligned to left and one to client). I want that the width of the child panels to be 25% of the width of the parent panel. I look at the demo examples but is not clear to me how to do it. The ServerModule.MainFormDisplay is set to mfPage, and the MainForm.WindowState is wsNormal. Thank you, Daniel
-
Hi All! Does anyone know, how to set the width at the UniMainMenu, (with word-wrap...)? Sincerely...
