Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.8.0 release #58

Merged
merged 22 commits into from
Nov 9, 2024
Merged
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
53f117e
allow an object instead of an array of an object
matyalatte Oct 12, 2024
05afe5e
update json schema and tutorial
matyalatte Oct 12, 2024
13fb230
remove redundant indentations from examples
matyalatte Oct 12, 2024
4455fe4
update screenshots in README.md
matyalatte Oct 12, 2024
dffa695
rename *-Windows-x64-ucrt.zip to *-Windows10-x64.zip (#50)
matyalatte Oct 13, 2024
0db6aa5
Merge pull request #51 from matyalatte/single_val_for_array
matyalatte Oct 21, 2024
4f78331
allow to define gui elements in root object
matyalatte Oct 25, 2024
9433531
update json schema, add tests
matyalatte Oct 25, 2024
86d0a39
update changelog
matyalatte Oct 25, 2024
4f79472
Merge pull request #52 from matyalatte/gui_as_root
matyalatte Oct 26, 2024
f7ae30e
update document for VSCode (#53)
matyalatte Oct 26, 2024
58733ef
make gui lables optional
matyalatte Oct 26, 2024
88d437d
remove gui labels from examples
matyalatte Oct 26, 2024
0463a1f
use window title as default value of GUI label
matyalatte Oct 26, 2024
4dce86c
Merge pull request #54 from matyalatte/gui_label_optional
matyalatte Oct 30, 2024
cb6c81b
Replace std::string with a custom string class (#56)
matyalatte Nov 4, 2024
e580216
redirect stderr to console window
matyalatte Nov 5, 2024
7f69774
truncate redirected strings to expected sizes, and simplify GetLastLine
matyalatte Nov 7, 2024
10e0c7b
add tests for validator.h
matyalatte Nov 7, 2024
6406657
Merge pull request #57 from matyalatte/redirect_stderr
matyalatte Nov 9, 2024
ea3b5d3
increment tuw version
matyalatte Nov 9, 2024
e254535
update docs
matyalatte Nov 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
- Array brackets can now be omitted when there is only one element.
- GUI elements can now be defined in root object.
- GUI labels became optional.
- "window_name" can now be default values of GUI labels.

ver 0.7.2
- Added "optional" to ignore some options when a text box is empty.
8 changes: 4 additions & 4 deletions examples/all_keys/gui_definition.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"minimum_required": "0.7.1",
"gui": [
{
"label": "Components Minimal",
"window_name": "Components Minimal",
"command": "echo file: %-% & echo folder: %-% & echo combo: %-% & echo radio: %-% & echo check: %-% & echo check_array: %-% & echo textbox: %-% & echo int: %-% & echo float: %-%",
"components": [
{
@@ -82,7 +82,7 @@
]
},
{
"label": "Components Optional",
"window_name": "Components Optional",
"command": "echo file: %file% & echo folder: %folder% & echo combo: %combo% & echo radio: %radio% & echo check: %check% & echo check_array: %options% & echo textbox: %text% & echo int: %integer% & echo float: %double%",
"components": [
{
@@ -248,8 +248,8 @@
]
},
{
"label": "GUI Optional",
"window_name": "Window Title Here",
"window_name": "GUI Optional",
"label": "GUI Optional (this string is for a menu item)",
"command_win": "echo home: %__HOME__% & echo cwd: %__CWD__% & echo percent: %% & echo sample message!",
"command_linux": "echo home: %__HOME__%; echo cwd: %__CWD__%; echo percent: %%; echo sample message!",
"command_mac": "echo home: %__HOME__%; echo cwd: %__CWD__%; echo percent: %%; echo sample message!",
1 change: 0 additions & 1 deletion examples/comp_options/affix/README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
```json
{
"gui": {
"label": "Affix example",
"command": "echo %-%",
"components": [
{
1 change: 0 additions & 1 deletion examples/comp_options/affix/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Affix example",
"command": "echo %-%",
"components": [
{
1 change: 0 additions & 1 deletion examples/comp_options/button/README.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ It allows you to rename the button associated with the picker component.
```json
{
"gui": {
"label": "Button",
"window_name": "Button sample",
"command": "echo %-% %-%",
"components": [
1 change: 0 additions & 1 deletion examples/comp_options/button/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Button",
"window_name": "Button sample",
"command": "echo %-% %-%",
"components": [
1 change: 0 additions & 1 deletion examples/comp_options/default/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Sample GUI",
"command": "echo file: %-% & echo options: %-%",
"components": [
{
3 changes: 0 additions & 3 deletions examples/comp_options/id/README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ You can use the defined ids as variable names in commands.

```json
{
"label": "IDs",
"command": "echo x: %x% & echo y: %y% & echo x: %x%",
"button": "Echo!",
"components": [
@@ -29,7 +28,6 @@ When you put an undefined id in `%*%`, it'll use one of the components that have

```json
{
"label": "Undefined IDs",
"command": "echo x: %-% & echo y: %y% & echo z: %foo%",
"button": "Echo!",
"components": [
@@ -61,7 +59,6 @@ There are some predefined ids.

```json
{
"label": "Reserved IDs",
"command": "echo percent: %% & echo cwd: %__CWD__% & echo home: %__HOME__%",
"button": "Echo!",
"components": []
1 change: 0 additions & 1 deletion examples/comp_options/optional/README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
```json
{
"gui": {
"label": "Optional component",
"command": "echo %-%",
"components": [
{
1 change: 0 additions & 1 deletion examples/comp_options/optional/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Optional component",
"command": "echo %-%",
"components": [
{
1 change: 0 additions & 1 deletion examples/comp_options/placeholder/README.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ It displays a message when the text box is empty.
```json
{
"gui": {
"label": "Placeholder",
"window_name": "Placeholder sample",
"command": "echo %-% %-% %-%",
"components": [
1 change: 0 additions & 1 deletion examples/comp_options/placeholder/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Placeholder",
"window_name": "Placeholder sample",
"command": "echo %-% %-% %-%",
"components": [
1 change: 0 additions & 1 deletion examples/comp_options/tooltip/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Sample GUI",
"command": "echo file: %-% & echo folder: %-% & echo options: %-%",
"components": [
{
1 change: 0 additions & 1 deletion examples/components/check_boxes/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Check Boxes",
"command": "echo checkbox: %-% & echo options:%-%",
"button": "Echo!",
"components": [
1 change: 0 additions & 1 deletion examples/components/choices/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Component Sample",
"command": "echo combo: %a% & echo radio: %b%",
"button": "Echo!",
"components": [
1 change: 0 additions & 1 deletion examples/components/num_pickers/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Select numbers",
"window_name": "Picker sample",
"command": "echo int: %-% & echo float: %-%",
"components": [
1 change: 0 additions & 1 deletion examples/components/other_components/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Component Sample",
"command": "echo textbox: %c%",
"button": "Echo!",
"components": [
1 change: 0 additions & 1 deletion examples/components/path_pickers/README.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ Of course, you can drop files on the pickers to specify the paths.
```json
{
"gui": {
"label": "Copy file",
"window_name": "Picker sample",
"command": "copy %foo% %bar%",
"button": "copy",
1 change: 0 additions & 1 deletion examples/components/path_pickers/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Copy file",
"window_name": "Picker sample",
"command": "copy %foo% %bar%",
"button": "copy",
2 changes: 0 additions & 2 deletions examples/get_start/minimal/README.md
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ It has only a button to echo `Hello!`.
```json
{
"gui": {
"label": "Minimal Sample",
"command": "echo Hello!",
"components": []
}
@@ -19,6 +18,5 @@ It has only a button to echo `Hello!`.

You can write a definition of your GUI in `"gui": {}`.

- `label` is the label for your definition. You can type anything you like here.
- `command` is the command you want to execute when clicking the execution button.
- `components` is an array of GUI components (e.g., file pickers). `[]` means no components.
1 change: 0 additions & 1 deletion examples/get_start/minimal/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Minimal Sample",
"command": "echo Hello!",
"components": []
}
1 change: 0 additions & 1 deletion examples/get_start/put_component/README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ You can put a text box in the GUI.
```json
{
"gui": {
"label": "Text Box Sample",
"window_name": "Title here!",
"command": "echo %-%",
"button": "Hello!",
1 change: 0 additions & 1 deletion examples/get_start/put_component/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Minimal Sample",
"window_name": "Title here!",
"command": "echo %-%",
"button": "Hello!",
1 change: 0 additions & 1 deletion examples/get_start/title_button/README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ You can rename the window title and the execution button.
```json
{
"gui": {
"label": "Minimal Sample",
"window_name": "Title here!",
"command": "echo Hello!",
"button": "Hello!",
1 change: 0 additions & 1 deletion examples/get_start/title_button/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Minimal Sample",
"window_name": "Title here!",
"command": "echo Hello!",
"button": "Hello!",
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"gui": {
"label": "Alternate Spellings",
"command": "echo folder: %-% & echo combo: %-% & echo check_array: %-% & echo textbox: %-% & echo int: %-%",
"title": "Alternate Spellings Sample",
"component_array": [
2 changes: 1 addition & 1 deletion examples/other_features/codepage/README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ Tuw expects user's default locale for stdout on Windows. If you want to use UTF-
```json
{
"gui": {
"label": "Use UTF-8 outputs on Windows",
"window_name": "Use UTF-8 outputs on Windows",
"command": "powershell -ExecutionPolicy Bypass -File \"utf.ps1\"",
"codepage": "utf8",
"components": []
2 changes: 1 addition & 1 deletion examples/other_features/codepage/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"gui": {
"label": "Use UTF-8 outputs on Windows",
"window_name": "Use UTF-8 outputs on Windows",
"command": "powershell -ExecutionPolicy Bypass -File \"utf.ps1\"",
"codepage": "utf8",
"components": []
2 changes: 0 additions & 2 deletions examples/other_features/cross_platform/README.md
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ Tuw will use the platform-specific command instead of the default `command` valu

```json
{
"label": "Platform Specific Commands",
"command_win": "echo Windows!",
"command_mac": "echo macOS!",
"command_linux": "echo Linux!",
@@ -35,7 +34,6 @@ Tuw will ignore the component if the current OS does not match the specified pla

```json
{
"label": "Platform Specific Components",
"command": "echo %os%",
"show_last_line": true,
"components": [
11 changes: 2 additions & 9 deletions examples/other_features/error/README.md
Original file line number Diff line number Diff line change
@@ -8,13 +8,8 @@ When the executed command outputs something to `stderr`, Tuw will display an err

```json
{
"gui": [
{
"label": "Error Sample",
"command": "notcommand",
"components": []
}
]
"command": "notcommand",
"components": []
}
```

@@ -26,7 +21,6 @@ You can also customize the success code using the `exit_success` option.

```json
{
"label": "check_exit_code Sample",
"command": "echo exit code is zero.",
"check_exit_code": true,
"exit_success": 10,
@@ -44,7 +38,6 @@ When `check_exit_code` is enabled, it can also show the last line in the error d

```json
{
"label": "show_last_line Sample",
"command": "echo Fake Error!",
"show_last_line": true,
"components": []
2 changes: 1 addition & 1 deletion examples/other_features/help/gui_definition.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"gui": {
"label": "Sample GUI",
"window_name": "Sample GUI",
"command": "echo file: %-% & echo folder: %-% & echo checkbox: %-%",
"components": [
{
33 changes: 32 additions & 1 deletion examples/other_features/multiple/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
# Multiple Definitions

`"gui"` can be an array of gui definitions.
Users can select one of the definitions from the `Menu` in the executable.
Users can select one of these definitions from the `Menu` in the executable.
You can also use `"label"` to modify strings that are displayed in the menu bar.
When `"label"` is not defined, `"window_name"` will be used as the GUI label.

![advanced](https://github.com/matyalatte/tuw/assets/69258547/956be42e-6931-4b71-ae3c-180103a93714)

```json
{
"gui": [
{
"label": "Sample GUI",
"command": "echo file: %-%",
"button": "Echo!",
"components": [
{
"type": "file",
"label": "Some file path"
}
]
},
{
"window_name": "Sample GUI2",
"command": "echo text_box: %-%",
"button": "Echo!",
"components": [
{
"type": "text",
"label": "Some text"
}
]
}
]
}
```
Loading