Skip to content

Commit d0b81e0

Browse files
authored
Merge pull request #4 from OUCC/sub
リリースに向けた調整
2 parents eb6ed74 + 5a187ae commit d0b81e0

File tree

5 files changed

+88
-27
lines changed

5 files changed

+88
-27
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 OUCC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ gnuplotのpltファイルをGUIから作成できるツール
66
gnuplot 5.4 patchlevel 6
77
OpenSiv3D 0.6.6
88

9+
## 使い方
10+
11+
1. plt Settingのwhole,graphに入力していく。
12+
(複数のグラフを重ねて描写したいなら+マークで増やす)
13+
2. plt Settingからplt Fileへの矢印を押してpltファイルを生成。
14+
3. (plt Fileのタブをクリックして中身を確認、保存)
15+
4. plt FileからImageへの矢印を押して画像を生成。
16+
5. 画像を確認、1.に戻って修正。
17+
6. 気に入ったら保存。
918

1019
## 画面構成
1120

@@ -39,13 +48,11 @@ OpenSiv3D 0.6.6
3948
- 歯車のアイコンボタン
4049

4150
のUIがある。
42-
矢印のアイコンボタンはそれぞれ、plt Settingの入力からplt Fileの生成、plt Fileを実行して画像の生成をするボタン。押すと生成中のアニメーションが再生されるが、実行時間とは無関係。
51+
**矢印のアイコンボタンはそれぞれ、plt Settingの入力からplt Fileの生成、plt Fileを実行して画像の生成をするボタン**。これを押さないと生成されない。押すと生成中のアニメーションが再生されるが、実行時間とは無関係。
4352
その他の項目(歯車含む)は切り替え式のタブで、中身は以下の通り。
4453

4554
- plt Setting
46-
- whole (軸などの全体設定)
47-
- graph1(それぞれのグラフの設定)
48-
- + (グラフの数を増やす。重ねて描画される。削除は右のゴミ箱ボタン)
55+
詳細は後述
4956
- plt File
5057
作成したpltファイル
5158
右上のSave asで保存できる。
@@ -56,6 +63,19 @@ OpenSiv3D 0.6.6
5663
テーマなどアプリの設定
5764
キーワードの省略(例:`linecolor``lc`)や、アプリのテーマカラーなどを指定できる
5865

66+
plt Settingのタブはその中にもタブを持つ。
67+
- whole
68+
軸などの全体設定
69+
- graph1
70+
それぞれのグラフの設定
71+
-
72+
グラフの数を増やす。複数のグラフは重ねて描画される。削除は右のゴミ箱ボタン
73+
74+
whole,graph の中身は下記入力項目を参照。
75+
グラフの数が画面端に差し掛かる場合、マウスホイールで左右にスクロールできる。
76+
77+
**注意**:データファイルを指定して描画する場合、生成されるplt Fileでは絶対パスで書かれるため、ユーザー名の流出などに注意。
78+
5979
### 入力項目
6080
チェックなしは今後追加したいもの
6181

@@ -73,23 +93,28 @@ OpenSiv3D 0.6.6
7393
- [x] using x:y
7494
- [ ] splot
7595
- [x] title
76-
- [x] withlines
96+
- [x] with lines
7797
- [x] linecolor
7898
- [x] linetype
7999
- [x] linewidth
80-
- [x] withpoints
100+
- [x] with points
81101
- [x] linecolor
82102
- [x] pointtype
83103
- [x] pointsize
104+
105+
※with linesとwith pointsは同時に指定できる(with linespoints)
106+
また、linecolorはwith pointsとwith linesで共通のため、両方に存在するが中身は同じ。
84107
- plt file
85108
- [x] reload
86109
- [x] save as
87110
- image
88111
- [x] reload
89112
- [x] save as
90113
- app options
114+
- [x] ライセンスの表示
91115
- [x] pltファイルでの色の指定がrgbかhsvか
92116
- [x] キーワードの省略
117+
- [x] アプリのテーマカラーの指定(Base,Main,Accent)
93118
- その他UI
94119
- [x] (plt setting -> plt file)のボタン
95120
- [x] (plt file -> image)のボタン
@@ -100,4 +125,6 @@ OpenSiv3D 0.6.6
100125
- [ ] データファイルのドラッグ&ドロップ
101126
- [ ] 拡張子の設定
102127
- [ ] plt Fileの編集、スクロール
128+
- [ ] テーマカラーなどの保存
129+
- [ ] ボタン一つでplt生成と画像生成を行うオプション
103130

pltGUI/Main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
void Main()
66
{
7+
Window::SetTitle(U"pltGUI");
8+
LicenseManager::DisableDefaultTrigger();
9+
710
FontAsset::Register(U"main", 20);
811
FontAsset::Register(U"bold", 20, Typeface::Bold);
912
TextureAsset::Register(U"save", 0xf0c7_icon, 30);

pltGUI/app_option.h

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,39 @@ class AppOption {
1414

1515
tabSpaceRect.draw(tabSpaceColor);
1616

17-
MyGUI::RadioButtonAreas(colorTypeIndex, Array{ Vec2(260, 150),Vec2(370,150) }, Array{ Vec2(60, 50) });
18-
MyGUI::Text(U"plt color as ", Vec2(120, 150));
19-
MyGUI::Text(U"RGB", Vec2(280, 150));
20-
MyGUI::Text(U"HSV", Vec2(390, 150));
17+
Vec2 dpos{100,150};
2118

22-
MyGUI::CheckBoxArea(shortword, Vec2(100, 205), Size(170, 50));
23-
MyGUI::Text(U"short keywords", Vec2(120, 205));
19+
RectF{ Arg::leftCenter= dpos, Size(600,60) }.draw(UIColor::ratio(0.1)).drawFrame(3,UIColor::ratio(0.9));
20+
MyGUI::Text(U"Lisence", dpos+Vec2(20, 0));
21+
if (MyGUI::Button(U"View in Browser", dpos + Vec2(150, 0),Size(170,40))) {
22+
System::LaunchBrowser(U"./Licenses.html");
23+
}
24+
25+
dpos += Vec2(0,100);
26+
MyGUI::RadioButtonAreas(colorTypeIndex, Array{ dpos+Vec2(160, 0),dpos+Vec2(270,0) }, Array{ Vec2(60, 50) });
27+
MyGUI::Text(U"plt color as ", dpos+Vec2(20, 0));
28+
MyGUI::Text(U"RGB", dpos+Vec2(180, 0));
29+
MyGUI::Text(U"HSV", dpos+Vec2(290, 0));
30+
31+
dpos += Vec2(0, 55);
32+
MyGUI::CheckBoxArea(shortword, dpos, Size(170, 50));
33+
MyGUI::Text(U"short keywords", dpos+Vec2(20, 0));
2434

35+
dpos += Vec2(0, 45);
2536
HSV base_{ UIColor::Base };
2637
HSV main_{ UIColor::Main };
2738
HSV accent_{ UIColor::Accent };
28-
FontAsset(U"main")(U"Base").drawAt(Vec2(200, 260), UIColor::ratio(0.9));
29-
FontAsset(U"main")(U"Main").drawAt(Vec2(380, 260), UIColor::ratio(0.9));
30-
FontAsset(U"main")(U"Accent").drawAt(Vec2(560, 260), UIColor::ratio(0.9));
31-
if (SimpleGUI::ColorPickerAt(base_, Vec2(200, 330))) {
39+
FontAsset(U"main")(U"Base").drawAt(dpos+Vec2(100, 0), UIColor::ratio(0.9));
40+
FontAsset(U"main")(U"Main").drawAt(dpos+Vec2(280, 0), UIColor::ratio(0.9));
41+
FontAsset(U"main")(U"Accent").drawAt(dpos+Vec2(460, 0), UIColor::ratio(0.9));
42+
dpos += Vec2(0, 70);
43+
if (SimpleGUI::ColorPickerAt(base_, dpos+Vec2(100, 0))) {
3244
UIColor::Base = base_.toColor();
3345
}
34-
if (SimpleGUI::ColorPickerAt(main_, Vec2(380, 330))) {
46+
if (SimpleGUI::ColorPickerAt(main_, dpos+Vec2(280, 0))) {
3547
UIColor::Main = main_.toColor();
3648
}
37-
if (SimpleGUI::ColorPickerAt(accent_, Vec2(560, 330))) {
49+
if (SimpleGUI::ColorPickerAt(accent_, dpos+Vec2(460, 0))) {
3850
UIColor::Accent = accent_.toColor();
3951
UpdateWaveImage();
4052
}

pltGUI/my_gui.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22
#include "ui_common.h"
33

4+
// This file is based on https://github.com/Siv3D/OpenSiv3D/blob/main/Siv3D/src/Siv3D/SimpleGUI/SivSimpleGUI.cpp (Siv3D version 0.6.6)
45

56
// Siv3dのSimpleGUIを改造したものや独自のものなど
67

@@ -37,21 +38,18 @@ namespace MyGUI {
3738
const Font& font = FontAsset(U"main");
3839
const auto dtext = font(label);
3940

40-
const RectF rect{ Arg::bottomCenter = center, size.x, size.y };
41-
const Vec2 labelPos{ center - Vec2{0,size.y / 2.0 } };
41+
const RectF rect{ Arg::leftCenter = center, size.x, size.y };
4242

4343
const bool mouseOver = rect.mouseOver() && Cursor::OnClientRect() && Window::GetState().focused;
44-
const bool pushed = mouseOver && Cursor::OnClientRect() && MouseL.down();
44+
const bool pushed = mouseOver && MouseL.down();
4545
const s3d::RoundRect rrect = rect.rounded(10);
46-
UIState uis{ mouseOver,pushed };
46+
UIState uis{ mouseOver,true };
4747

48-
rrect.draw(UIColor::bg(uis));
48+
rrect.draw(UIColor::ratio(mouseOver? 0 : 0.1));
4949

50-
if (not pushed) {
51-
rrect.drawFrame(1, UIColor::frame(uis));
52-
}
50+
rrect.drawFrame(1, UIColor::frame(uis));
5351

54-
dtext.drawAt(labelPos, UIColor::text(uis));
52+
dtext.drawAt(rect.center(), UIColor::text(uis));
5553

5654
if (mouseOver) {
5755
Cursor::RequestStyle(CursorStyle::Hand);

0 commit comments

Comments
 (0)