Jump to content

UniFieldSet with CheckBox


AmericoKutomi

Recommended Posts

I have a UniFieldSet which contains DBLookupComboBox, DBEdit and DBCheckBox.

The DBCheckBox occupies more width that I want.

image.png.0bb30f09450bba628af6eab98c62e376.png

The DBCheckBox width should be smaller. I would like to know what I am doing wrong.

This is the DFM part of the form:

object MainForm: TMainForm
  Left = 0
  Top = 0
  ClientHeight = 338
  ClientWidth = 586
  Caption = 'MainForm'
  OldCreateOrder = False
  MonitoredKeys.Keys = <>
  PixelsPerInch = 96
  TextHeight = 13
  object UniFieldSet5: TUniFieldSet
    Left = 0
    Top = 0
    Width = 586
    Height = 88
    Hint = ''
    CreateOrder = 1
    Title = 'Adicionar novo telefone'
    Align = alTop
    Layout = 'hbox'
    TabOrder = 0
    ExplicitLeft = -156
    ExplicitTop = 1
    ExplicitWidth = 641
    object UniDBLookupComboBox1: TUniDBLookupComboBox
      Left = 15
      Top = 18
      Width = 146
      Hint = ''
      CreateOrder = 1
      ListFormat = '%s'
      ListField = 'conteudo'
      KeyField = 'idtipo_telefone'
      ListFieldIndex = 0
      DataField = 'tipo_telefone'
      TabOrder = 1
      Color = clWindow
      LayoutConfig.Flex = 1
      FieldLabel = 'Tipo'
      FieldLabelAlign = laTop
      ForceSelection = True
    end
    object UniDBEdit6: TUniDBEdit
      Left = 127
      Top = 34
      Width = 50
      Height = 22
      Hint = ''
      CreateOrder = 2
      DataField = 'codigo_pais'
      TabOrder = 2
      LayoutConfig.Flex = 2
      LayoutConfig.Margin = '0 0 0 20'
      FieldLabel = 'Cod. Pa'#237's'
      FieldLabelWidth = 50
      FieldLabelAlign = laTop
    end
    object UniDBEdit7: TUniDBEdit
      Left = 188
      Top = 18
      Width = 177
      Height = 22
      Hint = ''
      CreateOrder = 3
      DataField = 'telefone'
      TabOrder = 3
      LayoutConfig.Flex = 3
      LayoutConfig.Margin = '0 0 0 20'
      FieldLabel = 'N'#186' Telefone com DDD'
      FieldLabelAlign = laTop
    end
    object UniDBCheckBox1: TUniDBCheckBox
      Left = 464
      Top = 18
      Width = 100
      Height = 17
      Hint = ''
      CreateOrder = 4
      DataField = 'app_mensagem'
      ValueChecked = '1'
      ValueUnchecked = '0'
      Caption = 'WhatsApp'
      TabOrder = 5
      ParentColor = False
      Color = clBtnFace
      LayoutConfig.Flex = 4
      LayoutConfig.Margin = '0 0 0 20'
      FieldLabel = 'Aceita Mensagem?'
      FieldLabelAlign = laTop
    end
    object UniDBEdit8: TUniDBEdit
      Left = 293
      Top = 36
      Width = 150
      Height = 22
      Hint = ''
      CreateOrder = 5
      DataField = 'descricao'
      TabOrder = 4
      LayoutConfig.Flex = 5
      LayoutConfig.Margin = '0 0 0 20'
      FieldLabel = 'Ramal ou outra informa'#231#227'o'
      FieldLabelWidth = 150
      FieldLabelAlign = laTop
    end
  end
  object UniButton1: TUniButton
    Left = 264
    Top = 216
    Width = 75
    Height = 25
    Hint = ''
    Caption = 'Close'
    TabOrder = 1
    OnClick = UniButton1Click
  end
end

Please, what I have to do to reduce the DBCheckBox width?

Additionally: what can I do to put a minimun width to DBLookupComboBox?

Link to comment
Share on other sites

1 hour ago, Sherzod said:

Maybe something like this for now:


procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniDBCheckBox1 do
  begin
    Width := 110;
    JSInterface.JSConfig('maxWidth', [Width]);
  end;

end;

 

It works fine. Thank you!

I have asked:

"Additionally: what can I do to put a minimun width to DBLookupComboBox?"

Is there 'minWidth', too?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...