Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ComponentBase {
- public function handleCreate(native:Bool) {
- trace('handleCreate for ${Type.getClassName(Type.getClass(this))} - native: ${native}');
- var className:String = Type.getClassName(Type.getClass(this));
- var nativeComponentClass:String = Toolkit.nativeConfig.query('component[id=${className}].@class', 'System.Windows.Forms.Panel');
- trace(nativeComponentClass);
- control = Type.createInstance(Type.resolveClass(nativeComponentClass), []);
- }
- private function handlePosition(left:Null<Float>, top:Null<Float>, style:Style) {
- trace('handlePosition for ${Type.getClassName(Type.getClass(this))} - left: ${left}, top: ${top}');
- if (control == null) {
- return;
- }
- control.Location = new Point(Std.int(left), Std.int(top));
- }
- private function handleSize(width:Null<Float>, height:Null<Float>, style:Style) {
- trace('handleSize for ${Type.getClassName(Type.getClass(this))} - width: ${width}, height: ${height}');
- if (control == null) {
- return;
- }
- control.Size = new Size(Std.int(width), Std.int(height));
- }
- }
- class ControlText extends Behaviour {
- public override function set(value:Variant) {
- if (value == null || value.isNull == true) {
- return;
- }
- trace("ControlText.set: " + value);
- _component.control.Text = value;
- }
- public override function get():Variant {
- return null;
- }
- }
- class ControlSize extends DelegateLayoutSize {
- private override function get_width():Float {
- return component.control.Size.Width;
- }
- private override function get_height():Float {
- return component.control.Size.Height;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement