コード例 #1
0
 public ExtendedModalWindowEventArgs( ExtendedModalWindow window, EExtendedModalWindowResult result )
     : this()
 {
     Window = window;
     Result = result;
 }
コード例 #2
0
 public void OK()
 {
     Result = EExtendedModalWindowResult.OK;
     IsDone = true;
     Event.current.Use();
 }
コード例 #3
0
        public virtual void OnGUI( int id )
        {
            if ( !isInitialized ) {
                Initialize();

                if ( alignToCenter ) {
                    AlignToCenter();
                }
            }

            if ( IsDraggable ) {
                GUI.DragWindow( new Rect( 0, 0, WindowRect.width, 17.5f ) );
            } else {
                if ( alignToCenter ) {
                    AlignToCenter();
                }
            }

            if ( showOKButton ) {
                if ( Input.KeyPressed( KeyCode.KeypadEnter ) || Input.KeyPressed( KeyCode.Return ) ) {
                    Event.current.Use();
                    Result = EExtendedModalWindowResult.OK;
                    IsDone = true;
                }
            }
            if ( showCancelButton ) {
                if ( Input.KeyPressed( KeyCode.Escape ) ) {
                    Event.current.Use();
                    Result = EExtendedModalWindowResult.Cancel;
                    IsDone = true;
                }
            }

            if ( showOKButton && showCancelButton ) {
                if ( GUI.Button( new Rect( WindowRect.width - 180, WindowRect.height - 30, 80, 20 ), textOKButton ) ) {
                    OK();
                }

                if ( GUI.Button( new Rect( WindowRect.width - 90, WindowRect.height - 30, 80, 20 ), textCancelButton ) ) {
                    Cancel();
                }
            } else if ( showOKButton || showCancelButton ) {
                var rect = new Rect( WindowRect.width - 90, WindowRect.height - 30, 80, 20 );

                if ( showOKButton ) {
                    if ( GUI.Button( rect, textOKButton ) ) {
                        OK();
                    }
                }

                if ( showCancelButton ) {
                    if ( GUI.Button( rect, textCancelButton ) ) {
                        Cancel();
                    }
                }
            }
        }
コード例 #4
0
 public void Cancel()
 {
     Result = EExtendedModalWindowResult.Cancel;
     IsDone = true;
     Event.current.Use();
 }