What does the Text DFM context menu option mean? - delphi

When you right click on a Delphi form you get the popup context menu. The bottom option is Text DFM. This option can either be checked or not checked. What does it mean when this option is checked or unchecked?

This option is used to select the format used to save your form (in binary or text format).
If you use the text DFM option, the form (dfm file) will be stored in a text format like so
object Form1: TForm1
Left = 451
Top = 290
Caption = 'Form38'
ClientHeight = 300
ClientWidth = 635
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
end

Related

Delphi - Button images suddenly not showing

Delphi 11.1 Windows application, suddenly my TButtons with images are not displaying the images. They normally don't display in debug mode, but now they're not showing in release mode.
These are TButton components with TImageList assigned and ImageIndex value assigned. I have several TBitBtn components that are displaying properly.
First screenshot shows TButton with miscButtons chosen as images and ImageIndex 16. The image shows in IDE. Second screenshot is running the application. I already changed Go To Activity to TSpeedButton, so the image is working.
object btnReqNewActivity: TButton
Left = 141
Top = 454
Width = 175
Height = 40
Caption = 'Request NEW Activity'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
ImageIndex = 16
ImageMargins.Left = 5
Images = miscButtons
ParentFont = False
TabOrder = 1
OnClick = btnReqNewActivityClick
end
object btnExportClassicList: TButton
Left = 333
Top = 454
Width = 78
Height = 40
Caption = 'Export'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
ImageIndex = 4
ImageMargins.Left = 5
Images = miscButtons
ParentFont = False
TabOrder = 2
OnClick = btnExportClassicListClick
end

non latin characters in popupmenu caption

I Have a Simple popup menu in a vcl application , but there is something weird happened when i write non-latin characters into the popup-menu Caption
the characters written correctly but it has this extra characters added (Z) at the end of the caption. this characters only added when i type non-latin words into the caption , English words shows correctly .
here is the dfm of the test project
object Form1: TForm1
Left = 0
Top = 0
BorderIcons = [biSystemMenu]
Caption = 'Form1'
ClientHeight = 242
ClientWidth = 472
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PopupMenu = PopupMenu1
PixelsPerInch = 96
TextHeight = 13
object PopupMenu1: TPopupMenu
Left = 232
Top = 128
object N1: TMenuItem
Caption = #1575#1604#1604#1594#1577' '#1575#1604#1593#1585#1576#1610#1577
end
end
end
and this is an image of how the result comes out . this extra (Z) i did not write it into the caption at all . i don't know why its showing any idea why ?
TPopupMenu tries to automatically set a hotkey for each menu item (if you didn't do this manually by using & char). You can change your PopupMenu.AutoHotkeys property value to maManual if you want to avoid this behaviour.

Delphi 2007 + PNG drop-shadowed shape + W10 = black frame

I created a PNG image with photoshop: a simple shape with a drop shadow. Then I put it in a TImage under Delphi 2007 (dependency: PNG library called "PngComponents"). Execution on Windows XP produces almost the expected result (background is Delphi IDE):
But on Windows 10 there's a black frame instead of the shadow:
Not tested on W7/W8 but I guess that I could get the same problem. Here is the dfm content:
object frmSplashScreen: TfrmSplashScreen
Left = 517
Top = 321
AlphaBlendValue = 0
AutoSize = True
BorderStyle = bsNone
ClientHeight = 392
ClientWidth = 528
Color = clBtnFace
TransparentColorValue = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Default'
Font.Style = []
FormStyle = fsStayOnTop
KeyPreview = True
OldCreateOrder = False
Position = poScreenCenter
OnClose = FormClose
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object imgLogo: TImage
Left = 0
Top = 0
Width = 528
Height = 392
AutoSize = True
Picture.Data = {44A(...)E426082}
Transparent = True
end
end
What's wrong with my image and/or settings?
I said that result on XP was almost the one expected: indeed if I change the background of the form (ie minimize the window under the splashscreen), well the transparent part of the image isn't refreshed:

Using DBCTRL Grid

I am using TDBCtrl Grid, and I can only see one record to see next record I have to scroll however I have set RowCount=5. Also, my dbgridCTRL can only allow TDBEdit or TEdit controls. I want to display static text also. Can you please suggest How can I display the Labels on DBCTRL Grid.
This is how the currently looks like. The Rans Member etc are staticText control. However I want to display multiple records at the same time.
object DBCtrlGrid1: TDBCtrlGrid
Left = 4
Top = 2
Width = 215
Height = 122
AllowDelete = False
AllowInsert = False
DataSource = DSCredit
PanelHeight = 122
PanelWidth = 199
TabOrder = 0
RowCount = 1
OnPaintPanel = DBCtrlGrid1PaintPanel
end
Height == PanelHeight * RowCount. And same for widths/columns.
You have to set sizes of panels and girds in a way, that several panels would fit inside the visible area of the grid. If the panel size is the same as the total size of all panels - then thereis just no places for other panels being visible.
PS. x-ref https://stackoverflow.com/questions/20658435/
Below is the example of DFM with the controls inside the Control Grid. The DFM example above shows empty grid without internal controls.
object Form9: TForm9
Left = 0
Top = 0
Caption = 'Form9'
ClientHeight = 390
ClientWidth = 635
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object grid1: TDBCtrlGrid
Left = 48
Top = 38
Width = 217
Height = 300
PanelHeight = 100
TabOrder = 0
object pnl1: TPanel
Left = 0
Top = 16
Width = 185
Height = 41
Caption = 'pnl1'
TabOrder = 0
object dbedt1: TDBEdit
Left = 48
Top = 11
Width = 121
Height = 21
TabOrder = 0
end
end
end
end

Why are condensed fonts not displayed properly in FireMonkey?

(And what can I do about it?)
If I create two labels in VCL and set one to use Arial and another Arial Narrow I'll see an expected result.
If I do the same in Firemonkey, the second label is not displayed in Arial Narrow. It is even not displayed in Arial (dots on i's are round, shape of 's' is all wrong etc.).
Does anybody know why FM (I was testing this with Delphi XE4) is not displaying the font properly? Is there anything I can do about it?
Source for the VCL form:
object Form3: TForm3
Left = 0
Top = 0
Caption = 'Form3'
ClientHeight = 198
ClientWidth = 475
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 24
Top = 32
Width = 134
Height = 14
Caption = 'This label is using Arial #11'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
end
object Label2: TLabel
Left = 24
Top = 52
Width = 152
Height = 15
Caption = 'This label is using Arial Narrow #11'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial Narrow'
Font.Style = []
ParentFont = False
end
object Label3: TLabel
Left = 24
Top = 98
Width = 398
Height = 36
Caption = 'This label is using Arial #32'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -32
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
end
object Label4: TLabel
Left = 24
Top = 140
Width = 429
Height = 37
Caption = 'This label is using Arial Narrow #32'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -32
Font.Name = 'Arial Narrow'
Font.Style = []
ParentFont = False
end
end
Source for the FM form:
object Form4: TForm4
Left = 0
Top = 0
Caption = 'Form4'
ClientHeight = 207
ClientWidth = 558
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [dkDesktop, dkiPhone, dkiPad]
DesignerMobile = False
DesignerWidth = 0
DesignerHeight = 0
DesignerDeviceName = ''
DesignerOrientation = 0
object Label1: TLabel
Font.Family = 'Arial'
StyledSettings = [ssSize, ssStyle, ssFontColor]
Height = 17.000000000000000000
Position.X = 16.000000000000000000
Position.Y = 32.000000000000000000
Text = 'This label is using Arial #11'
Width = 225.000000000000000000
end
object Label2: TLabel
Font.Family = 'Arial Narrow'
StyledSettings = [ssSize, ssStyle, ssFontColor]
Height = 17.000000000000000000
Position.X = 16.000000000000000000
Position.Y = 48.000000000000000000
Text = 'This label is using Arial Narrow #11'
Width = 225.000000000000000000
end
object Label3: TLabel
Font.Family = 'Arial'
Font.Size = 32.000000000000000000
StyledSettings = [ssStyle, ssFontColor]
Height = 41.000000000000000000
Position.X = 16.000000000000000000
Position.Y = 104.000000000000000000
Text = 'This label is using Arial #32'
Width = 433.000000000000000000
end
object Label4: TLabel
Font.Family = 'Arial Narrow'
Font.Size = 32.000000000000000000
StyledSettings = [ssStyle, ssFontColor]
Height = 65.000000000000000000
Position.X = 16.000000000000000000
Position.Y = 128.000000000000000000
Text = 'This label is using Arial Narrow #32'
Width = 545.000000000000000000
end
end
This seems to only affect fonts within families - if the font does not exist in the fonts folder under its own family name. Arial Narrow, for example, is a font within the "Arial" font file (it exists within a family and is not, per se, a family unto itself).
Typically a font family would include the four styles only
Arial (naively contains)
Arial Regular
Arial Bold
Arial Italic
Arial Bold Italic
"Arial Narrow", however, exists within the "Arial" family alongside the standard styles - ie :
Arial (actually contains)
Arial Regular
Arial Bold
Arial Italic
Arial Bold Italic
Arial Narrow
Arial Narrow Bold
Arial Narrow Italic
Arial Narrow Bold Italic
Arial Black
It seems that FMX is only looking one level deep within any given font family and is not looking at any style variant that deviates from the strict GDI+ style definitions (Regular, Bold, Italic, Bold Italic).
This also, by inspection, affects Arial Black - other examples are easy to find by running through your fonts folder. Franklin Gothic Demi, Gill Sans Ultra Bold, etc... anything that follows the above pattern. The font seems to be rendered in the default Segoe UI when these fonts are encountered.
A stopgap solution is to use Arial and set the Scale property to X=0.82 - it's not perfect, but it's quite close to Arial Narrow.
This is probably a bug and should be QC'd.

Resources