-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: actor components's translation/rotation lock
Part-of: #181
- Loading branch information
1 parent
2d1c64a
commit edf5042
Showing
2 changed files
with
109 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (c) 2012-2024 Daniele Bartolini et al. | ||
* SPDX-License-Identifier: GPL-3.0-or-later | ||
*/ | ||
|
||
namespace Crown | ||
{ | ||
public class CheckBox3 : Gtk.Box | ||
{ | ||
// Data | ||
public bool _stop_emit; | ||
|
||
// Widgets | ||
public CheckBox _x; | ||
public CheckBox _y; | ||
public CheckBox _z; | ||
public Gtk.Label _x_label; | ||
public Gtk.Label _y_label; | ||
public Gtk.Label _z_label; | ||
public Gtk.Box _x_box; | ||
public Gtk.Box _y_box; | ||
public Gtk.Box _z_box; | ||
|
||
// Signals | ||
public signal void value_changed(); | ||
|
||
public CheckBox3() | ||
{ | ||
Object(orientation: Gtk.Orientation.HORIZONTAL, spacing: 4); | ||
|
||
// Data | ||
_stop_emit = false; | ||
|
||
// Widgets | ||
_x = new CheckBox(); | ||
_y = new CheckBox(); | ||
_z = new CheckBox(); | ||
|
||
_x.value_changed.connect(on_value_changed); | ||
_y.value_changed.connect(on_value_changed); | ||
_z.value_changed.connect(on_value_changed); | ||
|
||
_x_label = new Gtk.Label("X"); | ||
_x_label.get_style_context().add_class("axis"); | ||
_x_label.get_style_context().add_class("x"); | ||
_y_label = new Gtk.Label("Y"); | ||
_y_label.get_style_context().add_class("axis"); | ||
_y_label.get_style_context().add_class("y"); | ||
_z_label = new Gtk.Label("Z"); | ||
_z_label.get_style_context().add_class("axis"); | ||
_z_label.get_style_context().add_class("z"); | ||
|
||
_x_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); | ||
_x_box.pack_start(_x_label, false); | ||
_x_box.pack_start(_x, true); | ||
|
||
_y_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); | ||
_y_box.pack_start(_y_label, false); | ||
_y_box.pack_start(_y, true); | ||
|
||
_z_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); | ||
_z_box.pack_start(_z_label, false); | ||
_z_box.pack_start(_z, true); | ||
|
||
this.pack_start(_x_box, true); | ||
this.pack_start(_y_box, true); | ||
this.pack_start(_z_box, true); | ||
} | ||
|
||
private void on_value_changed() | ||
{ | ||
if (!_stop_emit) | ||
value_changed(); | ||
} | ||
} | ||
|
||
} /* namespace Crown */ |