Author Topic: How to change the dialog title?  (Read 5619 times)

0 Members and 1 Guest are viewing this topic.

jxphklibin

  • Guest
How to change the dialog title?
« on: April 02, 2009, 03:02:02 AM »
How to change the dialog title?

The codes as follows:
Code: [Select]
(defun gps->getfiled  (/ str )
(setq str
  "Function GetTargetFileName
          Set objDialog = CreateObject(\"UserAccounts.CommonDialog\")
          objDialog.Filter = \"DwgFile(*.dwg)|*.dwg\"
          objDialog.InitialDir = \".\"
          If objDialog.ShowOpen <> 0 Then                 
               GetTargetFileName = objDialog.FileName
          End If
          Set objDialog = Nothing
End Function
ret = GetTargetFileName
"
  )
(if (not #wscript#)(setq #wscript# (vlax-create-object "ScriptControl")))
(vlax-put #wscript# 'language "vbs")
(vlax-invoke-method #wscript# 'ExecuteStatement str)
(vlax-invoke-method #wscript# 'eval "ret")
)


(defun Getfile (/ str )
(setq str
  "Function GetTargetFileName
          Set objDialog = CreateObject(\"UserAccounts.CommonDialog\")
          objDialog.Filter = \"DwgFile(*.dwg)|*.dwg|Word|.doc|Excel|.xls|All Files|*.*\"
          objDialog.Flags = 1574404
          objDialog.FilterIndex = 2
          objDialog.InitialDir = \"C:\"
          If objDialog.ShowOpen <> 0 Then                 
               GetTargetFileName = objDialog.FileName
          End If
          Set objDialog = Nothing
End Function
ret = GetTargetFileName
"
)

(if (not #wscript#)(setq #wscript# (vlax-create-object "ScriptControl")))
(vlax-put #wscript# 'language "vbs")
(vlax-invoke-method #wscript# 'ExecuteStatement str)
(vlax-invoke-method #wscript# 'eval "ret")
)

cjw

  • Guest
Re: How to change the dialog title?
« Reply #1 on: April 02, 2009, 08:13:39 AM »
objDialog.DialogTitle="Try it"

jxphklibin

  • Guest
Re: How to change the dialog title?
« Reply #2 on: April 02, 2009, 08:56:55 AM »
objDialog.DialogTitle="Try it"


; Error: Automation error. Object does not support this property or method: 'objDialog.DialogTitle'

jxphklibin

  • Guest
Re: How to change the dialog title?
« Reply #3 on: April 02, 2009, 09:00:23 AM »
_$ (vlax-dump-object (vlax-create-object "ScriptControl") t)
; IScriptControl: Control to host scripting engines that understand the ActiveX Scripting interface
;特性值:
;   AllowUI = ...不显示带索引的内容...
;   CodeObject (RO) = ...不显示带索引的内容...
;   Error (RO) = ...不显示带索引的内容...
;   Language = ...不显示带索引的内容...
;   Modules (RO) = ...不显示带索引的内容...
;   Procedures (RO) = ...不显示带索引的内容...
;   SitehWnd = ...不显示带索引的内容...
;   State = ...不显示带索引的内容...
;   Timeout = ...不显示带索引的内容...
;   UseSafeSubset = ...不显示带索引的内容...
;支持的方法:
;   AddCode (1)
;   AddObject (3)
;   Eval (2)
;   ExecuteStatement (1)
;   Reset ()
;   Run (3)
T
_$

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: How to change the dialog title?
« Reply #4 on: April 02, 2009, 09:06:02 AM »
objDialog.DialogTitle="Try it"


; Error: Automation error. Object does not support this property or method: 'objDialog.DialogTitle'
How about just objDialog.Title = "blah blah blah" ??
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

cjw

  • Guest
Re: How to change the dialog title?
« Reply #5 on: April 02, 2009, 09:08:13 AM »
(if (setq X (VLAX-CREATE-OBJECT "MSComDlg.CommonDialog"))
    (progn
      (VLAX-PUT-PROPERTY X "DialogTitle" DialogTitle)
      (VLAX-PUT-PROPERTY X "Filename" "")
      (VLAX-PUT-PROPERTY X "Filter" FILTER)
      (VLAX-PUT-PROPERTY X "MaxFileSize" 10000)
      (VLAX-PUT-PROPERTY X "Flags" 512)
      (VLAX-PUT-PROPERTY X "Action" 1)
      (VLAX-GET-PROPERTY X "Filename")
    )
  )

jxphklibin

  • Guest
Re: How to change the dialog title?
« Reply #6 on: April 02, 2009, 10:03:08 AM »
(if (setq X (VLAX-CREATE-OBJECT "MSComDlg.CommonDialog"))
    (progn
      (VLAX-PUT-PROPERTY X "DialogTitle" DialogTitle)
      (VLAX-PUT-PROPERTY X "Filename" "")
      (VLAX-PUT-PROPERTY X "Filter" FILTER)
      (VLAX-PUT-PROPERTY X "MaxFileSize" 10000)
      (VLAX-PUT-PROPERTY X "Flags" 512)
      (VLAX-PUT-PROPERTY X "Action" 1)
      (VLAX-GET-PROPERTY X "Filename")
    )
  )

How about just objDialog.Title = "blah blah blah" ??
also return:; Error: Automation error. Object does not support this property or method: 'objDialog.Title'

I know MSComDlg.CommonDialog can, but ScriptControl can not.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: How to change the dialog title?
« Reply #7 on: April 02, 2009, 10:38:51 AM »
Code: [Select]
(setq ddd (vlax-create-object "UserAccounts.CommonDialog"))
(vlax-dump-object ddd t)

;;Result
_$

; ICommonDialog: ICommonDialog Interface
; Valeurs de propriétés:
;   FileName = ""
;   Filter = ""
;   FilterIndex = type de résultat non pris en charge: 19
;   Flags = type de résultat non pris en charge: 19
;   InitialDir = ""
;   Owner (RO) = ...Contenu indexé masqué...
; Méthodes prises en charge:
;   ShowOpen ()

T
_$
Keep smile...

jxphklibin

  • Guest
Re: How to change the dialog title?
« Reply #8 on: April 02, 2009, 07:21:45 PM »
Code: [Select]
_$ (vlax-dump-object (vlax-create-object "UserAccounts.CommonDialog") t)
; ICommonDialog: ICommonDialog Interface
;特性值:
;   FileName = ""
;   Filter = ""
;   FilterIndex = 不支持结果类型: 19
;   Flags = 不支持结果类型: 19
;   InitialDir = ""
;   Owner (RO) = ...不显示带索引的内容...
;支持的方法:
;   ShowOpen ()
T
Yes, use the controls, that approach did not.

cjw

  • Guest
Re: How to change the dialog title?
« Reply #9 on: April 02, 2009, 09:41:03 PM »
(GPS->GETFILED)

select one file,and return return full path of the file selected!

(GETFILE)

select some files,but return the directory!

One question:

Could select some files,and return full path of the files selected???

Patrick_35

  • Guest
Re: How to change the dialog title?
« Reply #10 on: April 03, 2009, 05:14:14 AM »
Hi

Quote
Could select some files,and return full path of the files selected???
I've try it, but it's do not work :(

Just a question, for select one file, why you dont use getfiled function ?

If you want a dll that allows you to select multiple files

@+

Andrea

  • Water Moccasin
  • Posts: 2372
Re: How to change the dialog title?
« Reply #11 on: April 03, 2009, 09:45:49 AM »
Hi

Quote
Could select some files,and return full path of the files selected???
I've try it, but it's do not work :(

Just a question, for select one file, why you dont use getfiled function ?

If you want a dll that allows you to select multiple files

@+

cool !  Merci Patrick.
Keep smile...

Patrick_35

  • Guest
Re: How to change the dialog title?
« Reply #12 on: April 06, 2009, 05:03:35 AM »
C'est un plaisir Andrea

ps : pas très réactif le forum augi

@+