Why 2 Splitters Are Used

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Why 2 Splitters Are Used

Post by armsys » Sun Jan 23, 2011 10:46 am

Referring to http://www.mjtnet.com/forum/viewtopic.php?p=29062,
Why are 2 spliiter objects used?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Jan 23, 2011 8:25 pm

The first splitter object could easily have been a panel. It's just any convenient object to act as the left hand sizeable portion of the slider. A panel could equally have been used. Here's a version using a panel for the left hand part instead:

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  Left = 247
  Top = 96
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  BorderWidth = 2
  Caption = 'Slider & Display Example by Rain'
  ClientHeight = 150
  ClientWidth = 350
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  Position = poDesktopCenter
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object SliderDisplayLabel: TLabel
    Left = 24
    Top = 48
    Width = 68
    Height = 13
    Caption = 'Position: 50'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Panel1: TPanel
    Left = 24
    Top = 24
    Width = 114
    Height = 15
    BevelKind = bkFlat
    BevelOuter = bvNone
    BevelWidth = 3
    BorderStyle = bsSizeToolWin
    ParentBackground = False
    TabOrder = 0
    object Slider: TSplitter
      Left = 50
      Top = 0
      Width = 10
      Height = 11
      Cursor = crHandPoint
      Hint = 'Move Slider Left Or Right While Holding Your Mouse Button Down'
      Beveled = True
      Color = 16744448
      MinSize = 0
      ParentColor = False
      ResizeStyle = rsUpdate
      ExplicitLeft = 174
      ExplicitHeight = 20
    end
    object Panel4: TPanel
      Left = 0
      Top = 0
      Width = 50
      Height = 11
      Align = alLeft
      BevelOuter = bvNone
      Color = clGreen
      ParentBackground = False
      TabOrder = 0
    end
  end
  object ProgressBar1: TProgressBar
    Left = 0
    Top = 0
    Width = 350
    Height = 17
    Align = alTop
    Position = 50
    TabOrder = 1
  end
  object ProgressBar2: TProgressBar
    Left = 0
    Top = 17
    Width = 17
    Height = 114
    Align = alLeft
    Orientation = pbVertical
    Position = 50
    TabOrder = 2
  end
  object StatusBar1: TStatusBar
    Left = 0
    Top = 131
    Width = 350
    Height = 19
    Panels = <>
    SimplePanel = True
    SimpleText = 'Position: 50'
  end
end
EndDialog>Dialog1
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sun Jan 23, 2011 10:38 pm

Hi Marcus,
Thanks a lot. Your new design as well as Rain's helps us grasp how the Splitter objects are applied.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts