Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add defaultButton placeholder #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions haxe/ui/backend/DialogBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class DialogBase extends Component {
public var buttons:DialogButton = null;
public var centerDialog:Bool = true;
public var button:DialogButton = null;
public var defaultButton:String = null;

public var dialogContentContainer:VBox;
public var dialogContent:VBox;
Expand Down Expand Up @@ -56,6 +57,12 @@ class DialogBase extends Component {
buttonComponent.text = button.toString();
buttonComponent.userData = button;
buttonComponent.registerEvent(MouseEvent.CLICK, onFooterButtonClick);
trace(buttonComponent.text, defaultButton, buttonComponent.window);
//if (buttonComponent.window.id == defa)
//var dialog = cast(this.window, Dialog);
//dialog.addMainButtonId(buttonComponent.window.id);


addFooterComponent(buttonComponent);
}
}
Expand All @@ -74,6 +81,8 @@ class DialogBase extends Component {
if (c.window.size.height > nativeHeightModifier) {
nativeHeightModifier = c.window.size.height;
}
trace(c.window.id);
dialog.addMainButtonId(c.window.id);
}

_buttonSizer.realize();
Expand Down