Skip to content

Commit 5c468e4

Browse files
committed
update documents
1 parent a40e183 commit 5c468e4

17 files changed

+211
-84
lines changed

.github/workflows/build_all.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
run: |
8787
mkdir -p ../release
8888
cp build/Release/SimpleCommandRunner.exe ../release
89-
cp samples/advanced/gui_definition.json ../release
89+
cp samples/5_advanced/gui_definition.json ../release
9090
cp changelog.txt ../release
9191
cp license.txt ../release
9292
shell: bash
@@ -152,7 +152,7 @@ jobs:
152152
run: |
153153
mkdir -p ../release/${{ env.ZIP_NAME }}
154154
cp build/SimpleCommandRunner ../release/${{ env.ZIP_NAME }}
155-
cp samples/advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
155+
cp samples/5_advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
156156
cp changelog.txt ../release/${{ env.ZIP_NAME }}
157157
cp license.txt ../release/${{ env.ZIP_NAME }}
158158
cd ../release

.github/workflows/build_mac.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
run: |
4949
mkdir -p ../release/${{ env.ZIP_NAME }}
5050
cp build/SimpleCommandRunner ../release/${{ env.ZIP_NAME }}
51-
cp samples/advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
51+
cp samples/5_advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
5252
cp changelog.txt ../release/${{ env.ZIP_NAME }}
5353
cp license.txt ../release/${{ env.ZIP_NAME }}
5454
cd ../release

.github/workflows/build_ubuntu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
run: |
5353
mkdir -p ../release/${{ env.ZIP_NAME }}
5454
cp build/SimpleCommandRunner ../release/${{ env.ZIP_NAME }}
55-
cp samples/advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
55+
cp samples/5_advanced/gui_definition.json ../release/${{ env.ZIP_NAME }}
5656
cp changelog.txt ../release/${{ env.ZIP_NAME }}
5757
cp license.txt ../release/${{ env.ZIP_NAME }}
5858
cd ../release

.github/workflows/build_windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
run: |
6464
mkdir -p ../release
6565
cp build/Release/SimpleCommandRunner.exe ../release/
66-
cp samples/advanced/gui_definition.json ../release/
66+
cp samples/5_advanced/gui_definition.json ../release/
6767
cp changelog.txt ../release/
6868
cp license.txt ../release/
6969
shell: bash

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ All you need is write a `.json` file and run an `.exe` file.<br>
1010
It can make GUI to run commands of your scripts.<br>
1111
You don't need to use IDE and manage scripts for GUI.<br>
1212

13-
![sample](https://user-images.githubusercontent.com/69258547/166093114-4165e28a-452e-4844-a4d9-19b34bfe001c.png)<br>
13+
![sample](https://user-images.githubusercontent.com/69258547/171450112-8e1b40a0-36ae-4507-a4a7-2952d0bdbb52.png)![json](https://user-images.githubusercontent.com/69258547/171449741-859ca1bb-6f99-4e06-a7b9-a1873ca8b7eb.png)<br>
1414

1515
## Features
1616
- Cross-platform
1717
- Standalone
18-
- No need to use IDE for GUI
18+
- No need IDE for GUI
1919
- Define GUI in .json
2020

2121
## Platforms
@@ -35,7 +35,7 @@ Download `SimpleCommandRunner*.zip` from [here](https://github.com/matyalatte/Si
3535

3636

3737
## Samples
38-
There are some [sample json files](./samples) to understand how to use.<br>
38+
There are some [sample json files](./samples) to learn how to use.<br>
3939

4040
## License
4141
### Simple Command Runner

samples/1_minimal/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Minimal GUI
2+
This is a minimal GUI you can make.<br>
3+
It has only a button to echo `Hello!`.<br>
4+
5+
![minimal](https://user-images.githubusercontent.com/69258547/166092954-21dac225-07f8-43d2-b1d7-6df7c59625e6.png)
6+
7+
```
8+
{
9+
"gui": [
10+
{
11+
"label": "Minimal Sample",
12+
"command": "echo Hello!",
13+
"button": "Echo!",
14+
"components": []
15+
}
16+
]
17+
}
18+
```
19+
20+
You can write definition of your GUI in `gui: [{}]`.<br>
21+
`label` is a label of your definition. You can type here as you like.<br>
22+
`command` is a command you want to run when clicking the execution button.<br>
23+
`button` will be printed on the button.<br>
24+
`compoents` is an array of GUI components (e.g. file picker). `[]`
File renamed without changes.

samples/2_pickers/README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Pickers
2+
You can use file pickers and folder pickers.
3+
4+
![Pikcers](https://user-images.githubusercontent.com/69258547/171440880-5948a7f0-5e26-4c38-ab95-8c6daaf67f93.png)
5+
6+
```
7+
{
8+
"gui": [
9+
{
10+
"label": "Copy file",
11+
"window_name": "Picker sample",
12+
"command": "copy %file% %out_path%",
13+
"button": "copy",
14+
"components": [
15+
{
16+
"type": "file",
17+
"label": "A file you want to copy",
18+
"extension": "any files | *",
19+
"add_quotes": true
20+
},
21+
{
22+
"type": "folder",
23+
"label": "Output path",
24+
"add_quotes": true
25+
}
26+
]
27+
}
28+
]
29+
}
30+
```
31+
32+
`window_name` is an optional key to rename the window title of `SimpleCommandRunner.exe`.<br>
33+
`compoents` is an array of GUI components.<br>
34+
Each component will be defined as a dictionary.<br>
35+
`type` is component type. `file` is for file picker and `folder` is for dir picker.<br>
36+
`label` is a string written above the textbox of picker.<br>
37+
`extension` is an optional key for file picker. It's wildcard for file pickers. Use the same syntax as for [wxWidget's wildcards](https://docs.wxwidgets.org/3.0/classwx_file_dialog.html).<br>
38+
`add_quotes` is an optional key for components. It will add quotes to the input strings.<br>
39+
<br>
40+
Inputs of components will be injected into `command` when executing the command.<br>
41+
You can specifiy where you inject the inputs with `%*%`.<br>
42+
In the sample, file path will be injected in `%file%`, and folder path will be in %out_path%.

samples/2_pickers/gui_definition.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"gui": [
3+
{
4+
"label": "Copy file",
5+
"window_name": "Picker sample",
6+
"command": "copy %file% %out_path%",
7+
"button": "copy",
8+
"components": [
9+
{
10+
"type": "file",
11+
"label": "A file you want to copy",
12+
"extension": "any files | *",
13+
"add_quotes": true
14+
},
15+
{
16+
"type": "folder",
17+
"label": "Output path",
18+
"add_quotes": true
19+
}
20+
]
21+
}
22+
]
23+
}

samples/3_other_components/README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Other Components
2+
There are more components you can use.
3+
4+
![others](https://user-images.githubusercontent.com/69258547/171445898-7b696c95-a081-4a3a-aa66-71b8265f64d8.png)
5+
6+
```
7+
"components": [
8+
{
9+
"type": "static_text",
10+
"label": "This is a sample GUI. Edit 'gui_definition.json' for your scripts."
11+
},
12+
{
13+
"type": "choice",
14+
"label": "num",
15+
"items": ["one", "two", "three"],
16+
"values": ["1", "2", "3"],
17+
"default": 1
18+
},
19+
{
20+
"type": "check",
21+
"label": "checkbox",
22+
"value": "true"
23+
},
24+
{
25+
"type": "text_box",
26+
"label": "Some text"
27+
}
28+
]
29+
```
30+
31+
`static_text` is a string component. You don't need to put `%*%` in command for this component.<br>
32+
`choice` is a combo box. `values` will be inputted to command.<br>
33+
`check` is a check box. `value` will be inputted to command if you check the check box.<br>
34+
`text_box` is a text box.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"gui": [
3+
{
4+
"label": "Component Sample",
5+
"command": "echo choice: %% & echo checkbox: %% & echo textbox: %%",
6+
"button": "Echo!",
7+
"components": [
8+
{
9+
"type": "static_text",
10+
"label": "This is a sample GUI. Edit 'gui_definition.json' for your scripts."
11+
},
12+
{
13+
"type": "choice",
14+
"label": "num",
15+
"items": ["one", "two", "three"],
16+
"values": ["1", "2", "3"],
17+
"default": 1
18+
},
19+
{
20+
"type": "check",
21+
"label": "checkbox",
22+
"value": "true"
23+
},
24+
{
25+
"type": "text_box",
26+
"label": "Some text"
27+
}
28+
]
29+
}
30+
]
31+
}

samples/texconv/README.md samples/4_texconv/README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,22 @@ But it doesn't support GUI.<br>
44
So I made my own GUI for Texconv. <br>
55
Download texconv.exe form [here](https://github.com/microsoft/DirectXTex/releases) and put in the same directory as SimpleCommandRunner.exe and gui_definition.json.
66

7-
![texconv](https://user-images.githubusercontent.com/69258547/166093778-90ded69c-8db3-4531-b2d6-baf075f9c5f1.png)
7+
![texconv](https://user-images.githubusercontent.com/69258547/166093778-90ded69c-8db3-4531-b2d6-baf075f9c5f1.png)
8+
9+
It will add help urls to menu bar.<br>
10+
11+
```
12+
"help": [
13+
{
14+
"type": "url",
15+
"label": "About Texconv",
16+
"url": "https://github.com/microsoft/DirectXTex/wiki/Texconv"
17+
},
18+
{
19+
"type": "url",
20+
"label": "About Simple Command Runner",
21+
"url": "https://github.com/matyalatte/Simple-Command-Runner"
22+
}
23+
]
24+
```
25+
File renamed without changes.

samples/advanced/README.md samples/5_advanced/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
This is an advanced sample.<br>
33
It has 2 definitions for the command runner, and you can select them from `MENU`.<br>
44

5-
![advanced](https://user-images.githubusercontent.com/69258547/166093114-4165e28a-452e-4844-a4d9-19b34bfe001c.png)
5+
![advanced](https://user-images.githubusercontent.com/69258547/166093114-4165e28a-452e-4844-a4d9-19b34bfe001c.png)
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"gui": [
3+
{
4+
"label": "Sample GUI",
5+
"command": "echo file: %file% & echo folder: %folder% & echo num: %num% & echo checkbox: %check%",
6+
"button": "Echo!",
7+
"components": [
8+
{
9+
"type": "static_text",
10+
"label": "This is a sample GUI. Edit 'gui_definition.json' for your scripts."
11+
},
12+
{
13+
"type": "file",
14+
"label": "Some file path",
15+
"extension": "any files | *"
16+
},
17+
{
18+
"type": "folder",
19+
"label": "Some folder path"
20+
},
21+
{
22+
"type": "check",
23+
"label": "checkbox",
24+
"value": "true"
25+
}
26+
]
27+
}
28+
]
29+
}

samples/advanced/gui_definition.json

-69
This file was deleted.

samples/minimal/README.md

-5
This file was deleted.

0 commit comments

Comments
 (0)