From 14626509b1c6cf2aa7b40e6851e9308bf60add50 Mon Sep 17 00:00:00 2001 From: MrMocchy Date: Thu, 13 Apr 2023 17:18:29 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=82=BB=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=83=9C?= =?UTF-8?q?=E3=82=BF=E3=83=B3=E3=82=92=E4=BD=9C=E6=88=90=20app=20options?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E7=A4=BA=E3=81=AE=E6=94=B9=E8=89=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pltGUI/Main.cpp | 2 ++ pltGUI/app_option.h | 36 ++++++++++++++++++++++++------------ pltGUI/my_gui.h | 16 +++++++--------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/pltGUI/Main.cpp b/pltGUI/Main.cpp index c25466a..2b9f091 100644 --- a/pltGUI/Main.cpp +++ b/pltGUI/Main.cpp @@ -4,6 +4,8 @@ void Main() { + Window::SetTitle(U"pltGUI"); + FontAsset::Register(U"main", 20); FontAsset::Register(U"bold", 20, Typeface::Bold); TextureAsset::Register(U"save", 0xf0c7_icon, 30); diff --git a/pltGUI/app_option.h b/pltGUI/app_option.h index d7e2901..4228230 100644 --- a/pltGUI/app_option.h +++ b/pltGUI/app_option.h @@ -14,27 +14,39 @@ class AppOption { tabSpaceRect.draw(tabSpaceColor); - MyGUI::RadioButtonAreas(colorTypeIndex, Array{ Vec2(260, 150),Vec2(370,150) }, Array{ Vec2(60, 50) }); - MyGUI::Text(U"plt color as ", Vec2(120, 150)); - MyGUI::Text(U"RGB", Vec2(280, 150)); - MyGUI::Text(U"HSV", Vec2(390, 150)); + Vec2 dpos{100,150}; - MyGUI::CheckBoxArea(shortword, Vec2(100, 205), Size(170, 50)); - MyGUI::Text(U"short keywords", Vec2(120, 205)); + RectF{ Arg::leftCenter= dpos, Size(600,60) }.draw(UIColor::ratio(0.1)).drawFrame(3,UIColor::ratio(0.9)); + MyGUI::Text(U"Lisence", dpos+Vec2(20, 0)); + if (MyGUI::Button(U"View in Browser", dpos + Vec2(150, 0),Size(170,40))) { + LicenseManager::ShowInBrowser(); + } + + dpos += Vec2(0,100); + MyGUI::RadioButtonAreas(colorTypeIndex, Array{ dpos+Vec2(160, 0),dpos+Vec2(270,0) }, Array{ Vec2(60, 50) }); + MyGUI::Text(U"plt color as ", dpos+Vec2(20, 0)); + MyGUI::Text(U"RGB", dpos+Vec2(180, 0)); + MyGUI::Text(U"HSV", dpos+Vec2(290, 0)); + + dpos += Vec2(0, 55); + MyGUI::CheckBoxArea(shortword, dpos, Size(170, 50)); + MyGUI::Text(U"short keywords", dpos+Vec2(20, 0)); + dpos += Vec2(0, 45); HSV base_{ UIColor::Base }; HSV main_{ UIColor::Main }; HSV accent_{ UIColor::Accent }; - FontAsset(U"main")(U"Base").drawAt(Vec2(200, 260), UIColor::ratio(0.9)); - FontAsset(U"main")(U"Main").drawAt(Vec2(380, 260), UIColor::ratio(0.9)); - FontAsset(U"main")(U"Accent").drawAt(Vec2(560, 260), UIColor::ratio(0.9)); - if (SimpleGUI::ColorPickerAt(base_, Vec2(200, 330))) { + FontAsset(U"main")(U"Base").drawAt(dpos+Vec2(100, 0), UIColor::ratio(0.9)); + FontAsset(U"main")(U"Main").drawAt(dpos+Vec2(280, 0), UIColor::ratio(0.9)); + FontAsset(U"main")(U"Accent").drawAt(dpos+Vec2(460, 0), UIColor::ratio(0.9)); + dpos += Vec2(0, 70); + if (SimpleGUI::ColorPickerAt(base_, dpos+Vec2(100, 0))) { UIColor::Base = base_.toColor(); } - if (SimpleGUI::ColorPickerAt(main_, Vec2(380, 330))) { + if (SimpleGUI::ColorPickerAt(main_, dpos+Vec2(280, 0))) { UIColor::Main = main_.toColor(); } - if (SimpleGUI::ColorPickerAt(accent_, Vec2(560, 330))) { + if (SimpleGUI::ColorPickerAt(accent_, dpos+Vec2(460, 0))) { UIColor::Accent = accent_.toColor(); UpdateWaveImage(); } diff --git a/pltGUI/my_gui.h b/pltGUI/my_gui.h index 7020aa9..15e7415 100644 --- a/pltGUI/my_gui.h +++ b/pltGUI/my_gui.h @@ -1,6 +1,7 @@ #pragma once #include "ui_common.h" +// This file is based on https://github.com/Siv3D/OpenSiv3D/blob/main/Siv3D/src/Siv3D/SimpleGUI/SivSimpleGUI.cpp (Siv3D version 0.6.6) // Siv3dのSimpleGUIを改造したものや独自のものなど @@ -37,21 +38,18 @@ namespace MyGUI { const Font& font = FontAsset(U"main"); const auto dtext = font(label); - const RectF rect{ Arg::bottomCenter = center, size.x, size.y }; - const Vec2 labelPos{ center - Vec2{0,size.y / 2.0 } }; + const RectF rect{ Arg::leftCenter = center, size.x, size.y }; const bool mouseOver = rect.mouseOver() && Cursor::OnClientRect() && Window::GetState().focused; - const bool pushed = mouseOver && Cursor::OnClientRect() && MouseL.down(); + const bool pushed = mouseOver && MouseL.down(); const s3d::RoundRect rrect = rect.rounded(10); - UIState uis{ mouseOver,pushed }; + UIState uis{ mouseOver,true }; - rrect.draw(UIColor::bg(uis)); + rrect.draw(UIColor::ratio(mouseOver? 0 : 0.1)); - if (not pushed) { - rrect.drawFrame(1, UIColor::frame(uis)); - } + rrect.drawFrame(1, UIColor::frame(uis)); - dtext.drawAt(labelPos, UIColor::text(uis)); + dtext.drawAt(rect.center(), UIColor::text(uis)); if (mouseOver) { Cursor::RequestStyle(CursorStyle::Hand); From 730de7e613ec6fdfe5cc2926e1c076c837ba6f3d Mon Sep 17 00:00:00 2001 From: MrMocchy <84215956+MrMocchy@users.noreply.github.com> Date: Thu, 13 Apr 2023 17:21:13 +0900 Subject: [PATCH 2/4] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7b59191 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 OUCC + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 5160054efe2eec4cb47c585179f0d90ac0febf6c Mon Sep 17 00:00:00 2001 From: MrMocchy Date: Thu, 13 Apr 2023 18:15:59 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E6=99=82=E3=81=AB=E5=90=AB=E3=82=81=E3=82=8B=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=82=BB=E3=83=B3=E3=82=B9=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=82=92=E9=96=8B=E3=81=8F=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pltGUI/Main.cpp | 1 + pltGUI/app_option.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pltGUI/Main.cpp b/pltGUI/Main.cpp index 2b9f091..5bec3f1 100644 --- a/pltGUI/Main.cpp +++ b/pltGUI/Main.cpp @@ -5,6 +5,7 @@ void Main() { Window::SetTitle(U"pltGUI"); + LicenseManager::DisableDefaultTrigger(); FontAsset::Register(U"main", 20); FontAsset::Register(U"bold", 20, Typeface::Bold); diff --git a/pltGUI/app_option.h b/pltGUI/app_option.h index 4228230..e892c7f 100644 --- a/pltGUI/app_option.h +++ b/pltGUI/app_option.h @@ -19,7 +19,7 @@ class AppOption { RectF{ Arg::leftCenter= dpos, Size(600,60) }.draw(UIColor::ratio(0.1)).drawFrame(3,UIColor::ratio(0.9)); MyGUI::Text(U"Lisence", dpos+Vec2(20, 0)); if (MyGUI::Button(U"View in Browser", dpos + Vec2(150, 0),Size(170,40))) { - LicenseManager::ShowInBrowser(); + System::LaunchBrowser(U"./Licenses.html"); } dpos += Vec2(0,100); From 5a187aebafc7dbb7f82546f17a99c195675ed601 Mon Sep 17 00:00:00 2001 From: MrMocchy Date: Thu, 13 Apr 2023 18:17:01 +0900 Subject: [PATCH 4/4] =?UTF-8?q?readme=E3=81=AB=E4=BD=BF=E3=81=84=E6=96=B9?= =?UTF-8?q?=E3=81=AA=E3=81=A9=E3=82=92=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4f283ea..fcef3a5 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,15 @@ gnuplotのpltファイルをGUIから作成できるツール gnuplot 5.4 patchlevel 6 OpenSiv3D 0.6.6 +## 使い方 + +1. plt Settingのwhole,graphに入力していく。 +(複数のグラフを重ねて描写したいなら+マークで増やす) +2. plt Settingからplt Fileへの矢印を押してpltファイルを生成。 +3. (plt Fileのタブをクリックして中身を確認、保存) +4. plt FileからImageへの矢印を押して画像を生成。 +5. 画像を確認、1.に戻って修正。 +6. 気に入ったら保存。 ## 画面構成 @@ -39,13 +48,11 @@ OpenSiv3D 0.6.6 - 歯車のアイコンボタン のUIがある。 -矢印のアイコンボタンはそれぞれ、plt Settingの入力からplt Fileの生成、plt Fileを実行して画像の生成をするボタン。押すと生成中のアニメーションが再生されるが、実行時間とは無関係。 +**矢印のアイコンボタンはそれぞれ、plt Settingの入力からplt Fileの生成、plt Fileを実行して画像の生成をするボタン**。これを押さないと生成されない。押すと生成中のアニメーションが再生されるが、実行時間とは無関係。 その他の項目(歯車含む)は切り替え式のタブで、中身は以下の通り。 - plt Setting - - whole (軸などの全体設定) - - graph1(それぞれのグラフの設定) - - + (グラフの数を増やす。重ねて描画される。削除は右のゴミ箱ボタン) +詳細は後述 - plt File 作成したpltファイル 右上のSave asで保存できる。 @@ -56,6 +63,19 @@ OpenSiv3D 0.6.6 テーマなどアプリの設定 キーワードの省略(例:`linecolor`→`lc`)や、アプリのテーマカラーなどを指定できる +plt Settingのタブはその中にもタブを持つ。 +- whole +軸などの全体設定 +- graph1 +それぞれのグラフの設定 +- + +グラフの数を増やす。複数のグラフは重ねて描画される。削除は右のゴミ箱ボタン + +whole,graph の中身は下記入力項目を参照。 +グラフの数が画面端に差し掛かる場合、マウスホイールで左右にスクロールできる。 + +**注意**:データファイルを指定して描画する場合、生成されるplt Fileでは絶対パスで書かれるため、ユーザー名の流出などに注意。 + ### 入力項目 チェックなしは今後追加したいもの @@ -73,14 +93,17 @@ OpenSiv3D 0.6.6 - [x] using x:y - [ ] splot - [x] title - - [x] withlines + - [x] with lines - [x] linecolor - [x] linetype - [x] linewidth - - [x] withpoints + - [x] with points - [x] linecolor - [x] pointtype - [x] pointsize + + ※with linesとwith pointsは同時に指定できる(with linespoints) + また、linecolorはwith pointsとwith linesで共通のため、両方に存在するが中身は同じ。 - plt file - [x] reload - [x] save as @@ -88,8 +111,10 @@ OpenSiv3D 0.6.6 - [x] reload - [x] save as - app options + - [x] ライセンスの表示 - [x] pltファイルでの色の指定がrgbかhsvか - [x] キーワードの省略 + - [x] アプリのテーマカラーの指定(Base,Main,Accent) - その他UI - [x] (plt setting -> plt file)のボタン - [x] (plt file -> image)のボタン @@ -100,4 +125,6 @@ OpenSiv3D 0.6.6 - [ ] データファイルのドラッグ&ドロップ - [ ] 拡張子の設定 - [ ] plt Fileの編集、スクロール + - [ ] テーマカラーなどの保存 + - [ ] ボタン一つでplt生成と画像生成を行うオプション