Last question for Stringgridthings...i promise..
i also need different colwidth for my stringgrid...
look what i mean ...
object MSStringGrid1: tMSStringGrid
Left = 8
Top = 128
Width = 1881
Height = 769
BevelKind = bkSoft
Color = 15859696
ColCount = 10
DefaultRowHeight = 30
DefaultColWidth = 150
<-- Here i need
ColWidth = {
1st row 90
2nd row 130
} and so on ...what is the command for different width ?
I am shure i have seen it elsewhere...
RowCount = 100
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Times New Roman'
Font.Style = []
GridLineWidth = 2
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing]
ParentFont = False
TabOrder = 0
end
StringGrid Part III , different ColWidth
Moderators: Dorian (MJT support), JRL
-
- Pro Scripter
- Posts: 60
- Joined: Tue Dec 22, 2009 9:51 am
- Location: Mannheim ( Germany )
- Contact:
StringGrid Part III , different ColWidth
Oliver Hilger Mannheim
alias Olllllliii
alias Olllllliii
Why? Every time you ask a question I learn something. Keep asking.Last question for Stringgridthings...i promise..
ColWidths rather than ColWidth
Quick addition:
For the definitions of available grid options:
http://docwiki.embarcadero.com/Librarie ... GridOption
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 511
Top = 340
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 482
ClientWidth = 671
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object MSStringGrid1: tMSStringGrid
Left = 8
Top = 128
Width = 1881
Height = 769
BevelKind = bkSoft
Color = 15859696
ColCount = 10
DefaultColWidth = 150
DefaultRowHeight = 30
RowCount = 100
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Times New Roman'
Font.Style = []
GridLineWidth = 2
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing]
ParentFont = False
TabOrder = 0
ColWidths = (
90
130
220
150
150
150
40
150
150
150)
end
end
EndDialog>Dialog1
Show>dialog1,res1
Last edited by JRL on Wed Apr 03, 2013 7:12 pm, edited 1 time in total.
-
- Pro Scripter
- Posts: 60
- Joined: Tue Dec 22, 2009 9:51 am
- Location: Mannheim ( Germany )
- Contact:
You're quite welcome.
Its been cloudy here in Iowa too. Expecting another snowstorm tomorrow.
Also... If you add goRowSizing, goColSizing to the StringGrid Options the user can drag the column and row borders to manually change the column and row sizes similar to Excel. Now I wonder what could be done to autosize the columns. I don't see anything that relates to that. Maybe there's a way to code it.
Its been cloudy here in Iowa too. Expecting another snowstorm tomorrow.
Also... If you add goRowSizing, goColSizing to the StringGrid Options the user can drag the column and row borders to manually change the column and row sizes similar to Excel. Now I wonder what could be done to autosize the columns. I don't see anything that relates to that. Maybe there's a way to code it.
-
- Pro Scripter
- Posts: 60
- Joined: Tue Dec 22, 2009 9:51 am
- Location: Mannheim ( Germany )
- Contact:
I think we must write an Autosize routine... by ourself...
but i dont know how to calculate the Width for a Text in a Special Font...
Is there a Windows function that can do that ?
----> Text & Font in
<---- Pixelsize out
mhhh an l is much smaller than an M...mhhhh
After my work is done ...i will think about that...
but i dont know how to calculate the Width for a Text in a Special Font...
Is there a Windows function that can do that ?
----> Text & Font in
<---- Pixelsize out
mhhh an l is much smaller than an M...mhhhh
After my work is done ...i will think about that...
Oliver Hilger Mannheim
alias Olllllliii
alias Olllllliii
I posted THIS last year. I came up with the method because I couldn't find a better way. I think it might be too slow when importing a large CSV but of course I haven't tried it yet. Hmmmm... thinking about it, only the longest string in each column would need to be tested for pixel length, height. Since text parsing has been around longer than GUIs perhaps there is a better chance of finding a method to quickly find the longest string (in characters), then test that string for size (in pixels).but i dont know how to calculate the Width for a Text in a Special Font...
I think it would be relatively simple to test the string size at the time a user is entering it so auto sizing based on user input could also be possible.
It'll be at least 12 hours before I'll have a chance to try anything like this. If you come up with something sooner, please post it.
Hi olllllliii and JRL,
The ability to auto-size column width and/or height in a StringGrid object based on the data loaded would be a great feature even if its something we'd have to code ourselves.
A little Googling found the link below and even though its Delphi code, perhaps it will be helpful:
...autosize a StringGrid-Column to fit its content?
http://www.swissdelphicenter.ch/en/showcode.php?id=604
The ability to auto-size column width and/or height in a StringGrid object based on the data loaded would be a great feature even if its something we'd have to code ourselves.
A little Googling found the link below and even though its Delphi code, perhaps it will be helpful:
...autosize a StringGrid-Column to fit its content?
http://www.swissdelphicenter.ch/en/showcode.php?id=604
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
- Grovkillen
- Automation Wizard
- Posts: 1009
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: StringGrid Part III , different ColWidth
ColWidths, is it possible to change these using the SetDialogProperty>Dialog,MSStringGrid,ColWidths,Value ?
When I try nothing happens, when I try a "GetDialogProperty" nothing is returned (no such property exists).
Please advice. Thanks!
When I try nothing happens, when I try a "GetDialogProperty" nothing is returned (no such property exists).
Please advice. Thanks!
Re: StringGrid Part III , different ColWidth
Don't know what you want to do. You can set all of the columns to the same thing using:
Also by setting the "Options" property correctly the user can change the column size using the mouse.
Code: Select all
SetDialogProperty>Dialog1,MSStringGrid1,DefaultColWidth,30
- Grovkillen
- Automation Wizard
- Posts: 1009
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: StringGrid Part III , different ColWidth
When I manually change the widths of the columns in the dialog designer their sizes is stored in the dialog properties but I cannot fetch them with a GetDialogProperty call, and not set them with a SetDialogProperty call...
This is found in the dialog property :
This is found in the dialog property :
Code: Select all
ColWidths = (
90
130
220
150
150
150
40
150
150
150)
- Grovkillen
- Automation Wizard
- Posts: 1009
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: StringGrid Part III , different ColWidth
Markus, do you have any idea on how to set and fetch column widths?
- Marcus Tettmar
- Site Admin
- Posts: 7378
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: StringGrid Part III , different ColWidth
Sadly I'm afraid this isn't currently possible. There is currently no way to access the column objects directly.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Grovkillen
- Automation Wizard
- Posts: 1009
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: StringGrid Part III , different ColWidth
All right, thanks for clearing that though.