| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- //--- OBJECT WRITE BEGIN ---
- %guiContent = new GuiControl(MessageBoxSaveChangesDlg, EditorGuiGroup) {
- canSaveDynamicFields = "0";
- Profile = "ToolsGuiDefaultProfile";
- HorizSizing = "width";
- VertSizing = "height";
- position = "0 0";
- Extent = "1024 768";
- MinExtent = "8 8";
- canSave = "1";
- Visible = "1";
- hovertime = "1000";
- new GuiWindowCtrl(MBSaveChangesFrame) {
- canSaveDynamicFields = "0";
- Profile = "ToolsGuiWindowProfile";
- HorizSizing = "center";
- VertSizing = "center";
- position = "362 274";
- Extent = "340 164";
- MinExtent = "48 92";
- canSave = "1";
- Visible = "1";
- hovertime = "1000";
- text = "Save Changes";
- maxLength = "255";
- resizeWidth = "1";
- resizeHeight = "1";
- canMove = "1";
- canClose = "0";
- canMinimize = "0";
- canMaximize = "0";
- minSize = "50 50";
- new GuiIconButtonCtrl(mbSaveDlgSaveButton) {
- canSaveDynamicFields = "0";
- Profile = "ToolsGuiButtonProfile";
- HorizSizing = "right";
- VertSizing = "bottom";
- position = "240 117";
- Extent = "83 25";
- MinExtent = "8 2";
- canSave = "1";
- Visible = "1";
- hovertime = "1000";
- text = "Save";
- groupNum = "-1";
- buttonType = "PushButton";
- iconBitmap = "~/levelEditor/gui/images/iconAccept.png";
- sizeIconToButton = "0";
- textLocation = "Center";
- textMargin = "4";
- buttonMargin = "4 4";
- };
- new GuiIconButtonCtrl(mbSaveDlgCancelButton) {
- canSaveDynamicFields = "0";
- Profile = "ToolsGuiButtonProfile";
- HorizSizing = "right";
- VertSizing = "bottom";
- position = "158 117";
- Extent = "83 25";
- MinExtent = "8 2";
- canSave = "1";
- Visible = "1";
- hovertime = "1000";
- text = "Cancel";
- groupNum = "-1";
- buttonType = "PushButton";
- iconBitmap = "~/levelEditor/gui/images/iconCancel.png";
- sizeIconToButton = "0";
- textLocation = "Center";
- textMargin = "4";
- buttonMargin = "4 4";
- };
- new GuiIconButtonCtrl(mbSaveDlgDontButton) {
- canSaveDynamicFields = "0";
- Profile = "ToolsGuiButtonProfile";
- HorizSizing = "right";
- VertSizing = "bottom";
- position = "14 117";
- Extent = "124 25";
- MinExtent = "8 2";
- canSave = "1";
- Visible = "1";
- hovertime = "1000";
- text = "Don\'t Save";
- groupNum = "-1";
- buttonType = "PushButton";
- sizeIconToButton = "0";
- textLocation = "Center";
- textMargin = "4";
- buttonMargin = "4 4";
- };
- new GuiControl() {
- canSaveDynamicFields = "0";
- Profile = "ToolsGuiDefaultProfile";
- HorizSizing = "right";
- VertSizing = "bottom";
- position = "13 31";
- Extent = "310 73";
- MinExtent = "8 2";
- canSave = "1";
- Visible = "1";
- hovertime = "1000";
- new GuiTextCtrl() {
- canSaveDynamicFields = "0";
- Profile = "EditorTextHLBoldLeft";
- HorizSizing = "right";
- VertSizing = "bottom";
- position = "15 9";
- Extent = "281 26";
- MinExtent = "8 2";
- canSave = "1";
- Visible = "1";
- hovertime = "1000";
- text = "Do you want to save changes to this document?";
- maxLength = "1024";
- };
- new GuiTextCtrl() {
- canSaveDynamicFields = "0";
- Profile = "ToolsGuiDefaultProfile";
- HorizSizing = "right";
- VertSizing = "bottom";
- position = "15 38";
- Extent = "258 21";
- MinExtent = "8 2";
- canSave = "1";
- Visible = "1";
- hovertime = "1000";
- text = "If you don\'t save, your changes may be lost.";
- maxLength = "1024";
- };
- };
- };
- };
- //--- OBJECT WRITE END ---
- function MessageBoxSaveChangesDlg::onWake( %this )
- {
- MBSaveChangesFrame.setText( %this.Data );
- }
- function mbSaveDlgSaveButton::onClick( %this )
- {
- if( MessageBoxSaveChangesDlg.SaveCallback !$= "" )
- eval( MessageBoxSaveChangesDlg.SaveCallback @ "(" @ MessageBoxSaveChangesDlg.Data @ ");" );
- Canvas.popDialog( MessageBoxSaveChangesDlg );
- }
- function mbSaveDlgCancelButton::onClick( %this )
- {
- Canvas.popDialog( MessageBoxSaveChangesDlg );
- }
- function mbSaveDlgDontButton::onClick( %this )
- {
- if( MessageBoxSaveChangesDlg.DontSaveCallback !$= "" )
- eval( MessageBoxSaveChangesDlg.DontSaveCallback @ "(" @ MessageBoxSaveChangesDlg.Data @ ");" );
- Canvas.popDialog( MessageBoxSaveChangesDlg );
- }
- // Deprecated when platform layers are all sufficient
- function checkSaveChangesOld( %data, %saveCallback, %dontSaveCallback )
- {
- // Sanity Check
- if( MessageBoxSaveChangesDlg.isAwake() )
- {
- warn("Save Changes Dialog already Awake, NOT creating second instance.");
- return;
- }
-
- // Set Proper State
- MessageBoxSaveChangesDlg.SaveCallback = %saveCallback;
- MessageBoxSaveChangesDlg.DontSaveCallback = %dontSaveCallback;
- MessageBoxSaveChangesDlg.Data = %data;
-
- // Show Dialog
- Canvas.pushDialog( MessageBoxSaveChangesDlg );
- }
|