View Single Post
  #9  
Old 04-05-2007, 10:57 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Much thanks. Here is another little script I made after the waitfor() was implemented.
PHP Code:
public function showInputDialog(titlelabeldefvalwaittime) {
  
temp.out 0// Return data

  
new GuiWindowCtrl("InputDialog") {
    
this.profile "GuiWindowProfile";
    
this.extent = {240,115};
    
this.position = {
      (
screenwidth this.extent[0]) / 2,
      (
screenheight this.extent[1]) / 2
    
};
    
this.canMaximize false;
    
this.canMinimize false;
    
this.canResize false;
    
this.canClose false;
    
this.text title;
    
this.visible true;

    new 
GuiTextCtrl("InputDialog_Label") {
      
this.profile "GuiDarkRedTextProfile";
      
this.position = {3030};
      
this.text label;
    }
    new 
GuiTextEditCtrl("InputDialog_Field") {
      
this.profile "GuiTextEditProfile";
      
this.position = {1550};
      
this.extent = {21020};
      
this.text defval;
    }
    new 
GuiButtonCtrl("InputDialog_Button") {
      
this.profile "GuiButtonProfile";
      
this.position = {9075};
      
this.extent = {6025};
      
this.text "OK";
    }
    new 
GuiButtonCtrl("InputDialog_ButtonCancel") {
      
this.profile "GuiButtonProfile";
      
this.position = {16075};
      
this.extent = {6025};
      
this.text "Cancel";
    }
  }
  
InputDialog.bringToFront();
  if (
waitfor("InputDialog_Button","onAction",waittime) == true) {
    
out InputDialog_Field.text;
    
InputDialog.destroy();
    return 
out;
  }
  else {
    
InputDialog.destroy();
    return 
null;
  }
}
public function 
InputDialog_ButtonCancel.onAction() {
  
InputDialog_Field.text "";
  
InputDialog_Button.performclick();

__________________
Reply With Quote