Topic: Interface command: Open File Box; Open Dir Box  (Read 2163 times)

0 Members and 1 Guest are viewing this topic.

Interface command: Open File Box; Open Dir Box
« on: February 09, 2016, 07:14:41 AM »

Gerhard S.

  • Jr. Chef
  • **
  • Date Registered: Dec 2015
  • Posts: 95
Question:

pFileBox declared as "file":
-> If I hit manually on pFileBox in Interface - FileOpen dialog (Windows API?) starts. One chooses then a file -->   %pFileBox% = choosen file
pFileBox declared as "dir":
-> If I hit manually on pFileBox in Interface - DirOpen dialog (Windows API?) starts. One chooses then a directory -->   %pFileBox% = choosen directory

Is there a, or are there fixed command(s) to use in script, so equal DirOpen dialog/FileOpen dialog can be started per script-command?

(I programmed an Interface extension, because I found no command or macro for this theme)
« Last Edit: February 09, 2016, 07:19:28 AM by Gerhard S. »

Re: Interface command: Open File Box; Open Dir Box
« Reply #1 on: February 09, 2016, 07:18:35 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
Call,OpenDir,

Re: Interface command: Open File Box; Open Dir Box
« Reply #2 on: February 09, 2016, 07:21:37 AM »

Gerhard S.

  • Jr. Chef
  • **
  • Date Registered: Dec 2015
  • Posts: 95
"Call,OpenDir," is not that I need. "Call,OpenDir,"  starts not dialog, this starts explorer at a given path. 

What I do manually on pFileBox in Interface --> I want to do/invoke in Script.
« Last Edit: February 09, 2016, 07:26:44 AM by Gerhard S. »

Re: Interface command: Open File Box; Open Dir Box
« Reply #3 on: February 09, 2016, 07:27:53 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
 Call,OpenDir,= choosen directory

Call,OpenDir,C:\You\are\here

Re: Interface command: Open File Box; Open Dir Box
« Reply #4 on: February 09, 2016, 07:48:46 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7012
here is an idea:
Check
Utils\Reg Reconvert -> "Pick File" button
-->
you can write result to filebox ("Pick File" button do that)


*
If your goal is to stop during build and open file dialog to select file,
 we avoid this kind of design on plugins,
  instead we add pre check to plugins ex: ".Net Framework" plugin [VerificationP]

such dialog things more suitable with Level=10 plugins, also used on Emulator plugins (Select ISO button)

:turtle:

Re: Interface command: Open File Box; Open Dir Box
« Reply #5 on: February 09, 2016, 12:22:52 PM »

Gerhard S.

  • Jr. Chef
  • **
  • Date Registered: Dec 2015
  • Posts: 95
I'm at work, nightline. Principal I follow your basic minds, to avoid (something). But allow me the notice, that execution instructions at building time are "allowed"; f.i. 'ShellExecute'.
My goal is an additional function for the Script-Interface. I already avoid (something) - my extension is placed in a subsection [Change_RadioBox]; and never under [process]. And yes, I see you know me - I "need" this for a level 10 plugin.
I know the Murphy's law  :lol:

I will show you my custom RadioBox (linked with Win API)...
Second goal: Should also work even if user hasn't started Building yet.
« Last Edit: February 09, 2016, 03:37:53 PM by Gerhard S. »

Re: Interface command: Open File Box; Open Dir Box
« Reply #6 on: February 09, 2016, 10:49:22 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7012
Following your basic mind, just a reminder,

no need to get things complex when it is possible to do simple.  :wink:

anyway, have fun  :great:

Re: Interface command: Open File Box; Open Dir Box
« Reply #7 on: February 10, 2016, 07:17:23 AM »

Gerhard S.

  • Jr. Chef
  • **
  • Date Registered: Dec 2015
  • Posts: 95
Now I changed my idea. No macro, no external exe. Scripted everything with built-in commands.

A combination of these components : RadioGroup & FileBox [triggered by: RadioGroup|Section to run]
My goal is: To avoid a second FileBox; [more safety]check existence of dir / file. And this is -so I guess- not new.  :cool:

The program flow:
[starting point:] Single File was successfuly used/choosen in the past ('successfuly' means: file exists). Now you want to input(to change to) a directory.
(As usual, text 'Folder' & associated RadioButton change their color to blue, if you approaching them with mousepointer. This behavior is caused by Builder.)

ila_rendered

[User clicked on RadioGroup 'Folder':] Now, Script/Builder cuts off from FileBox the filename and checks, if the resulting path is existent.
Here in this example, the resulting path is existent. The RadioGroup changes automatically to 'Folder'.

ila_rendered 

===================================================================
Back again, FileBox's state is 'file'; RadioGroup's state is 'Single file' - and file C:\Users\hgw\Pictures\labor.jpg exists.
Now you manually manipulate FileBox to a non-existent path: C:\Users\hgw\Pictur\labor.jpg
Hit on RadioGroup 'Folder':

ila_rendered

The FileBox shows a invitation to select a folder.
Note: The RadioGroup refuses to change to 'Folder':

ila_rendered

Optional:
-> Because the RadioGroup's state is still 'Single File' -> the internal %pFileBox% variable remains also still the same as previous last working %PathTo\filename%.
 In this example: C:\Users\hgw\Pictures\labor.jpg
-> At least ensures, that Script can go on with a working File.


Just like that with 'Single file' ...
« Last Edit: February 10, 2016, 08:24:01 AM by Gerhard S. »

Re: Interface command: Open File Box; Open Dir Box
« Reply #8 on: February 10, 2016, 09:52:09 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7012
There is already a trick for that on PC Packed (Plugin Creator Packed) plugin

Utils\PC Packed -> Options

as default you select source file on filebox. (with title "Point Packed File")

Enable 'Point Folder' -> button -->

now you can select source folder on filebox. (with title "Point folder to be packed")

both ways, PC Packed plugin creates a working new plugin:thumbsup:

only here we use button(s) to get compatible between projects, to get full compatible plugin.
still it is only a simple copy paste to use on another plugin where one needs (very rare !)....
« Last Edit: February 10, 2016, 09:53:25 AM by Lancelot »

Re: Interface command: Open File Box; Open Dir Box
« Reply #9 on: February 12, 2016, 07:39:56 AM »

Gerhard S.

  • Jr. Chef
  • **
  • Date Registered: Dec 2015
  • Posts: 95
"Copy & Paste"
Put a FileBox anywhere on Interface;
Put a RadioGroup anywhere on Interface; Set RadioGroup-SectionToRun to 'Folder_Single_File';
Variables: Set pFileBox_Name  (ex. =pFileBox1);
Variables: Set pRadioGroup_Name (ex. =pRadioGroup1);
Copy & Paste Sections [Folder_Single_File], [Spezial_Ini_Read], [Search_Character], [Search_Character_From_Left].

ila_rendered

Experiment with rearranging FileBox and RadioGroup:

ila_rendered

I'm responsible for failures.  :lol:

Edit: Code snippet Script_Test 2.script (25.28 kB - downloaded 2 times.) - away.
« Last Edit: February 12, 2016, 07:46:13 PM by Gerhard S., Reason: code snippet not intended to be compatible plugin. »

Re: Interface command: Open File Box; Open Dir Box
« Reply #10 on: February 12, 2016, 08:24:28 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7012
I'm responsible for failures.  :lol:

only here we use button(s) to get compatible between projects, to get full compatible plugin.
still it is only a simple copy paste to use on another plugin where one needs (very rare !)....

I wrote initially, now a bit more detailed:

On TheOven we create plugins compatible between projects, where there are mainly 2 projects, Gena and SE series.
we use BuilderGena.exe on Gena project, where builder version is 77rc2  077.102
SE projects use BuilderSE.exe where builder version is 082rv3 82.0.0.15

radiobutton run feature not supported by BuilderGena.exe ,
 It is only used on SE special plugins (ex: Utils\Extract Wim Folders -Advanced button -> Detect and use the best image index - Choose manually )
  For General Plugins to get compatible between all projects, we use method explained on previous post with Utils\PC Packed.


As a result, if you use radio run feature on SE special plugins fine  :thumbsup:
If your goal is creating a general plugin (ex: vlc) we do not put incompatible general plugins to plugin servers for distribution,
 still you are free on your plugin topics.  :thumbsup:

With this organisation, we create plugins for only projects around TheOven.org , which will not work anywhere else.

If your goal is playing with script, which is by defination a standalone package, with a builder version you like (there are newer, I guess 083 and maybe something more, or older, or mid versions......). , you are on wrong forum, we do not create scripts here.
 Overall for such goal I advice you to play with AutoIT with AutoIT scripts, which is at least a light year far better than builder we use for projects, and have a very quality forum with lots of script writing informations.

:turtle:

 

Powered by EzPortal