OpenSiv3D icon indicating copy to clipboard operation
OpenSiv3D copied to clipboard

複数行の入力ができるテキストボックス

Open Reputeless opened this issue 2 years ago • 2 comments

reported by: https://siv3d.slack.com/archives/C03MZP8SH/p1652414866150069

Reputeless avatar May 13 '22 04:05 Reputeless

Siv3D Slack: #textArea 仮実装: https://gist.github.com/kerochan/d5034b86a485f328fecef69d57add75c

Reputeless avatar Jun 01 '22 16:06 Reputeless

レビュー 1 回目: https://gist.github.com/Reputeless/6d969e825be71c0205048fbfe60ed179

Reputeless avatar Jun 13 '22 14:06 Reputeless

サンプル

# include <Siv3D.hpp> // OpenSiv3D v0.6.9

void Main()
{
	Scene::SetBackground(ColorF{ 0.8, 0.9, 1.0 });

	const String text = TextReader{ U"example/LICENSE.txt" }.readAll();

	TextAreaEditState textAreaEditState{ text };

	bool enabled = true;

	while (System::Update())
	{
		if (SimpleGUI::Button(U"クリア", Vec2{ 40, 40 }, 100, TextInput::GetEditingText().isEmpty()))
		{
			textAreaEditState.clear();
		}

		SimpleGUI::CheckBox(enabled, U"enabled", Vec2{ 160, 40 });

		SimpleGUI::TextArea(textAreaEditState, Vec2{ 40, 90 }, SizeF{ 600, 300 }, SimpleGUI::PreferredTextAreaMaxChars, enabled);
	}
}

Reputeless avatar Apr 10 '23 12:04 Reputeless