Dialog Properties Example - MSched v12

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Dialog Properties Example - MSched v12

Post by Rain » Wed Nov 24, 2010 8:22 pm

Image

Submitted by: Rain

Macro Scheduler Version: 12

Description: Allows the user the see what Dialog property values do or look like.

Select a property value from the list and click Do Selected. Some property values may not work in combination with others. Try different property value combinations.

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  Left = 110
  Top = 145
  HelpContext = 5000
  AlphaBlendValue = 240
  BorderIcons = [biSystemMenu]
  Caption = 'Dialog Properties Example'
  ClientHeight = 525
  ClientWidth = 534
  Color = clBtnFace
  DockSite = True
  DragKind = dkDock
  DragMode = dmAutomatic
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  PopupMode = pmAuto
  Position = poDefault
  PrintScale = poNone
  ShowHint = False
  OnTaskBar = True
  PixelsPerInch = 96
  TextHeight = 13
  object MSListBox1: tMSListBox
    Left = 0
    Top = 0
    Width = 534
    Height = 449
    Align = alTop
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'Verdana'
    Font.Style = []
    ItemHeight = 13
    Items.Strings = (
      'Dialog Property BorderStyle: bsSizeToolWin'
      'Dialog Property BorderStyle: bsToolWindow'
      'Dialog Property BorderStyle: bsDialog'
      'Dialog Property BorderStyle: bsSizeable'
      'Dialog Property BorderStyle: bsSingle'
      'Dialog Property BorderStyle: bsNone'
      '-'
      'Dialog Property BorderWidth: 0'
      'Dialog Property BorderWidth: 1'
      'Dialog Property BorderWidth: 5'
      'Dialog Property BorderWidth: 10'
      '-'
      'Dialog Property Caption: My Dialog PropertyCaption #1'
      'Dialog Property Caption: My Dialog PropertyCaption #2'
      '-'
      'Dialog Property BorderIcons: Close'
      'Dialog Property BorderIcons: Close + Minimize'
      'Dialog Property BorderIcons: Close + Maximize + Minimize'
      'Dialog Property BorderIcons: Close + Help'
      'Dialog Property BorderIcons: None'
      '-'
      'Dialog Property FormStyle: fsStayOnTop'
      'Dialog Property FormStyle: fsMDIForm'
      'Dialog Property FormStyle: fsMDIChild (Example Not Possible)'
      'Dialog Property FormStyle: fsNormal'
      '-'
      'Dialog Property Color: Red'
      'Dialog Property Color: Black'
      'Dialog Property Color: Green'
      'Dialog Property Color: Blue'
      '-'
      'Dialog Property Position: poOwnerFormCenter'
      'Dialog Property Position: poMainFormCenter'
      'Dialog Property Position: poDesktopCenter'
      'Dialog Property Position: poScreenCenter'
      'Dialog Property Position: poDefaultSizeOnly'
      'Dialog Property Position: poDefaultPosOnly'
      'Dialog Property Position: poDefault'
      'Dialog Property Position: poDesigned'
      '-'
      'Dialog Property AlphaBlend: On'
      'Dialog Property AlphaBlend: Off'
      'Dialog Property AlphaBlendValue: 255 Max'
      'Dialog Property AlphaBlendValue: 200'
      'Dialog Property AlphaBlendValue: 100'
      '-'
      'Dialog Property WindowState: wsNormal'
      'Dialog Property WindowState: wsMaximized'
      'Dialog Property WindowState: wsMinimized'
      '-'
      'Dialog Property Align: alCustom'
      'Dialog Property Align: alClient'
      'Dialog Property Align: alRight'
      'Dialog Property Align: alLeft'
      'Dialog Property Align: alBottom'
      'Dialog Property Align: alTop'
      'Dialog Property Align: alNone')
    ParentFont = False
    TabOrder = 0
    Text = 
      'Dialog Property BorderStyle: bsSizeToolWin'#13#10'Dialog Property Bord' +
      'erStyle: bsToolWindow'#13#10'Dialog Property BorderStyle: bsDialog'#13#10'Di' +
      'alog Property BorderStyle: bsSizeable'#13#10'Dialog Property BorderSty' +
      'le: bsSingle'#13#10'Dialog Property BorderStyle: bsNone'#13#10'-'#13#10'Dialog Pro' +
      'perty BorderWidth: 0'#13#10'Dialog Property BorderWidth: 1'#13#10'Dialog Pro' +
      'perty BorderWidth: 5'#13#10'Dialog Property BorderWidth: 10'#13#10'-'#13#10'Dialog' +
      ' Property Caption: My Dialog PropertyCaption #1'#13#10'Dialog Property' +
      ' Caption: My Dialog PropertyCaption #2'#13#10'-'#13#10'Dialog Property Borde' +
      'rIcons: Close'#13#10'Dialog Property BorderIcons: Close + Minimize'#13#10'Di' +
      'alog Property BorderIcons: Close + Maximize + Minimize'#13#10'Dialog P' +
      'roperty BorderIcons: Close + Help'#13#10'Dialog Property BorderIcons: ' +
      'None'#13#10'-'#13#10'Dialog Property FormStyle: fsStayOnTop'#13#10'Dialog Property' +
      ' FormStyle: fsMDIForm'#13#10'Dialog Property FormStyle: fsMDIChild (Ex' +
      'ample Not Possible)'#13#10'Dialog Property FormStyle: fsNormal'#13#10'-'#13#10'Dia' +
      'log Property Color: Red'#13#10'Dialog Property Color: Black'#13#10'Dialog Pr' +
      'operty Color: Green'#13#10'Dialog Property Color: Blue'#13#10'-'#13#10'Dialog Prop' +
      'erty Position: poOwnerFormCenter'#13#10'Dialog Property Position: poMa' +
      'inFormCenter'#13#10'Dialog Property Position: poDesktopCenter'#13#10'Dialog ' +
      'Property Position: poScreenCenter'#13#10'Dialog Property Position: poD' +
      'efaultSizeOnly'#13#10'Dialog Property Position: poDefaultPosOnly'#13#10'Dial' +
      'og Property Position: poDefault'#13#10'Dialog Property Position: poDes' +
      'igned'#13#10'-'#13#10'Dialog Property AlphaBlend: On'#13#10'Dialog Property AlphaB' +
      'lend: Off'#13#10'Dialog Property AlphaBlendValue: 255 Max'#13#10'Dialog Prop' +
      'erty AlphaBlendValue: 200'#13#10'Dialog Property AlphaBlendValue: 100'#13 +
      #10'-'#13#10'Dialog Property WindowState: wsNormal'#13#10'Dialog Property Windo' +
      'wState: wsMaximized'#13#10'Dialog Property WindowState: wsMinimized'#13#10'-' +
      #13#10'Dialog Property Align: alCustom'#13#10'Dialog Property Align: alClie' +
      'nt'#13#10'Dialog Property Align: alRight'#13#10'Dialog Property Align: alLef' +
      't'#13#10'Dialog Property Align: alBottom'#13#10'Dialog Property Align: alTop' +
      #13#10'Dialog Property Align: alNone'#13#10
    SelectedIndex = -1
    ExplicitWidth = 400
  end
  object MSButton1: tMSButton
    Left = 8
    Top = 456
    Width = 75
    Height = 33
    Caption = 'Do Selected'
    DoubleBuffered = True
    ParentDoubleBuffered = False
    TabOrder = 1
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSButton2: tMSButton
    Left = 112
    Top = 456
    Width = 75
    Height = 33
    Caption = 'Exit'
    DoubleBuffered = True
    ParentDoubleBuffered = False
    TabOrder = 2
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>Dialog1

Show>Dialog1


AddDialogHandler>Dialog1,MSButton1,OnClick,DoSelected
AddDialogHandler>Dialog1,MSButton2,OnClick,DoExit


Label>loop
wait>.1
Goto>loop



SRT>DoSelected
GetDialogProperty>Dialog1,MSListBox1,SelectedItems,ListBox1Value

//Change Dialog Border Style
if>ListBox1Value=Dialog Property BorderStyle: bsSizeToolWin
CloseDialog>Dialog1
SetDialogProperty>Dialog1,,BorderStyle,bsSizeToolWin
Show>Dialog1
endif
if>ListBox1Value=Dialog Property BorderStyle: bsToolWindow
CloseDialog>Dialog1
SetDialogProperty>Dialog1,,BorderStyle,bsToolWindow
Show>Dialog1
endif
if>ListBox1Value=Dialog Property BorderStyle: bsDialog
CloseDialog>Dialog1
SetDialogProperty>Dialog1,,BorderStyle,bsDialog
Show>Dialog1
endif
if>ListBox1Value=Dialog Property BorderStyle: bsSizeable
CloseDialog>Dialog1
SetDialogProperty>Dialog1,,BorderStyle,bsSizeable
Show>Dialog1
endif
if>ListBox1Value=Dialog Property BorderStyle: bsSingle
CloseDialog>Dialog1
SetDialogProperty>Dialog1,,BorderStyle,bsSingle
Show>Dialog1
endif
if>ListBox1Value=Dialog Property BorderStyle: bsNone
CloseDialog>Dialog1
SetDialogProperty>Dialog1,,BorderStyle,bsNone
Show>Dialog1
endif



//Change Dialog Border Width
if>ListBox1Value=Dialog Property BorderWidth: 0
SetDialogProperty>Dialog1,,BorderWidth,0
endif
if>ListBox1Value=Dialog Property BorderWidth: 1
SetDialogProperty>Dialog1,,BorderWidth,1
endif
if>ListBox1Value=Dialog Property BorderWidth: 5
SetDialogProperty>Dialog1,,BorderWidth,5
endif
if>ListBox1Value=Dialog Property BorderWidth: 10
SetDialogProperty>Dialog1,,BorderWidth,10
endif



//Change Dialog Caption
if>ListBox1Value=Dialog Property Caption: My Dialog PropertyCaption #1
SetDialogProperty>Dialog1,,Caption,Dialog Properties Example - My Dialog Caption #1
endif
if>ListBox1Value=Dialog Property Caption: My Dialog PropertyCaption #2
SetDialogProperty>Dialog1,,Caption,Dialog Properties Example - My Dialog Caption #2
endif



//Change Dialog Border Icons
if>ListBox1Value=Dialog Property BorderIcons: Close
SetDialogProperty>Dialog1,,BorderIcons,[biSystemMenu]
endif
if>ListBox1Value=Dialog Property BorderIcons: Close + Minimize
SetDialogProperty>Dialog1,,BorderIcons,[biSystemMenu, biMinimize]
endif
if>ListBox1Value=Dialog Property BorderIcons: Close + Maximize + Minimize
SetDialogProperty>Dialog1,,BorderIcons,[biSystemMenu, biMinimize, biMaximize]
endif
if>ListBox1Value=Dialog Property BorderIcons: Close + Help
SetDialogProperty>Dialog1,,BorderIcons,[biSystemMenu, biHelp]
endif
if>ListBox1Value=Dialog Property BorderIcons: None
SetDialogProperty>Dialog1,,BorderIcons,
endif



//Change Form Style
if>ListBox1Value=Dialog Property FormStyle: fsStayOnTop
SetDialogProperty>Dialog1,,FormStyle,fsStayOnTop
endif
if>ListBox1Value=Dialog Property FormStyle: fsMDIForm
SetDialogProperty>Dialog1,,FormStyle,fsMDIForm
endif
if>ListBox1Value=Dialog Property FormStyle: fsMDIChild  (Example Not Possible)
/*
SetDialogProperty>Dialog1,,FormStyle,fsMDIChild
*/
endif
if>ListBox1Value=Dialog Property FormStyle: fsNormal
SetDialogProperty>Dialog1,,FormStyle,fsNormal
endif



//Change Dialog Color
if>ListBox1Value=Dialog Property Color: Red
SetDialogProperty>Dialog1,,Color,255
endif
if>ListBox1Value=Dialog Property Color: Black
SetDialogProperty>Dialog1,,Color,0
endif
if>ListBox1Value=Dialog Property Color: Green
SetDialogProperty>Dialog1,,Color,32768
endif

if>ListBox1Value=Dialog Property Color: Blue
SetDialogProperty>Dialog1,,Color,16711680
endif



//Change Dialog Position
if>ListBox1Value=Dialog Property Position: poOwnerFormCenter
SetDialogProperty>Dialog1,,Position,poOwnerFormCenter
endif
if>ListBox1Value=Dialog Property Position: poMainFormCenter
SetDialogProperty>Dialog1,,Position,poMainFormCenter
endif
if>ListBox1Value=Dialog Property Position: poDesktopCenter
SetDialogProperty>Dialog1,,Position,poDesktopCenter
endif
if>ListBox1Value=Dialog Property Position: poScreenCenter
SetDialogProperty>Dialog1,,Position,poScreenCenter
endif
if>ListBox1Value=Dialog Property Position: poDefaultSizeOnly
SetDialogProperty>Dialog1,,Position,poDefaultSizeOnly
endif
if>ListBox1Value=Dialog Property Position: poDefaultPosOnly
SetDialogProperty>Dialog1,,Position,poDefaultPosOnly
endif
if>ListBox1Value=Dialog Property Position: poDefault
SetDialogProperty>Dialog1,,Position,poDefault
endif
if>ListBox1Value=Dialog Property Position: poDesigned
SetDialogProperty>Dialog1,,Position,poDesigned
endif



//Change Dialog Opacity
if>ListBox1Value=Dialog Property AlphaBlend: On
SetDialogProperty>Dialog1,,AlphaBlend,True
endif
if>ListBox1Value=Dialog Property AlphaBlend: Off
SetDialogProperty>Dialog1,,AlphaBlend,False
endif
if>ListBox1Value=Dialog Property AlphaBlendValue: 255 Max
SetDialogProperty>Dialog1,,AlphaBlendValue,255
endif
if>ListBox1Value=Dialog Property AlphaBlendValue: 200
SetDialogProperty>Dialog1,,AlphaBlendValue,200
endif
if>ListBox1Value=Dialog Property AlphaBlendValue: 100
SetDialogProperty>Dialog1,,AlphaBlendValue,100
endif



//Change Window State
if>ListBox1Value=Dialog Property WindowState: wsNormal
SetDialogProperty>Dialog1,,WindowState,wsNormal
endif
if>ListBox1Value=Dialog Property WindowState: wsMaximized
SetDialogProperty>Dialog1,,WindowState,wsMaximized
endif
if>ListBox1Value=Dialog Property WindowState: wsMinimized
SetDialogProperty>Dialog1,,WindowState,wsMinimized
endif



//Change Dialog Alignment
if>ListBox1Value=Dialog Property Align: alCustom
SetDialogProperty>Dialog1,,Align,alCustom
endif
if>ListBox1Value=Dialog Property Align: alClient
SetDialogProperty>Dialog1,,Align,alClient
endif
if>ListBox1Value=Dialog Property Align: alRight
SetDialogProperty>Dialog1,,Align,alRight
endif
if>ListBox1Value=Dialog Property Align: alLeft
SetDialogProperty>Dialog1,,Align,alLeft
endif
if>ListBox1Value=Dialog Property Align: alBottom
SetDialogProperty>Dialog1,,Align,alBottom
endif
if>ListBox1Value=Dialog Property Align: alTop
SetDialogProperty>Dialog1,,Align,alTop
endif
if>ListBox1Value=Dialog Property Align: alNone
SetDialogProperty>Dialog1,,Align,alNone
endif


END>DoSelected



SRT>DoExit
  Exit>0
END>DoExit


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