Do the MSG_ parameters work with the Input dialog?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Do the MSG_ parameters work with the Input dialog?

Post by SandyDoss » Tue Sep 19, 2017 10:15 pm

Hi,

I want to position an Input dialog box. Can I do this using the MSG_XPOS and MSG_YPOS? Or do I have to build my own dialog box?

Thanks

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Do the MSG_ parameters work with the Input dialog?

Post by JRL » Wed Sep 20, 2017 3:49 am

You'll have to create your own dialog or do something like this.

Code: Select all

DeleteFile>%temp_dir%MoveInput.scp
LabelToVar>MoveInput,vScript
WriteLn>%temp_dir%MoveInput.scp,wres,vScript
Let>Rp_Wait=0
RunProgram>%Command_Line% %temp_dir%MoveInput.scp

Input>res,Type something.
DeleteFile>%temp_dir%MoveInput.scp

/*
MoveInput:
WaitWindowOpen>Macro Scheduler Input
MoveWindow>Macro Scheduler Input,100,100
*/

zabros2020
Pro Scripter
Posts: 70
Joined: Sun May 03, 2009 11:49 pm
Location: AU

Re: Do the MSG_ parameters work with the Input dialog?

Post by zabros2020 » Sun Oct 01, 2017 6:32 am

you could also try this:

Code: Select all

'VB VERSION
'-----------
VBSTART
  Function VBInput(xpos,ypos)
    MSGBOX xpos&" "&ypos
    'InputBox(prompt[,title][,default][,xpos][,ypos][,helpfile,context])
    VBInput = InputBox("PROMPT Please enter something","TITLE Enter something","DEFAULT Enter here",xpos,ypos)
  End Function
VBEND

VBEval>VBInput(100,200),vbInputText
MessageModal>VB INPUT WAS: %vbInputText%


'MS VERSION
'-----------
Dialog>DialogInput
object DialogInput: TForm
  Left = 247
  Top = 96
  HelpContext = 5000
  BorderIcons = []
  BorderStyle = bsSingle
  Caption = 'Input'
  ClientHeight = 56
  ClientWidth = 192
  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 lblInput: TLabel
    Left = 7
    Top = 5
    Width = 75
    Height = 13
    Caption = 'Input something'
  end
  object txtInput: TEdit
    Left = 6
    Top = 19
    Width = 121
    Height = 21
    HelpType = htKeyword
    TabOrder = 0
  end
  object btnOk: tMSButton
    Left = 134
    Top = 16
    Width = 47
    Height = 25
    Caption = 'OK'
    TabOrder = 1
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>DialogInput

GetScreenRes>srXw,srYh
GetDialogProperty>DialogInput,,Width,dlgWidth
GetDialogProperty>DialogInput,,Height,dlgHeight
'center the dialog
Let>dlgLeft={Round(%srXw%/2)-(%dlgWidth%/2)}
Let>dlgTop={Round(%srYh%/2)-(%dlgHeight%/2)}
SetDialogProperty>DialogInput,,Left,dlgLeft
SetDialogProperty>DialogInput,,Top,dlgTop

AddDialogHandler>DialogInput,btnOk,OnClick,CheckInput
AddDialogHandler>DialogInput,txtInput,OnChange,GetInput

Show>DialogInput,

SRT>CheckInput
  GetDialogProperty>DialogInput,txtInput,Text,inputText
  Length>inputText,chkLen
  If>chkLen=0
    MessageModal>Please enter something...
    GetDialogProperty>DialogInput,txtInput,Focus,inputText
  Else
    CloseDialog>DialogInput
    MessageModal>something was entered: %inputText%
  EndIf
END>CheckInput

SRT>GetInput
  GetDialogProperty>DialogInput,txtInput,Text,inputText
END>GetInput

Loving MS's Capabilities!!!

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