|  [problem] Buttons in windows | 
| Author: | 
Message: | 
waynewilson2 
Junior Member 
  
  
  
 
Posts: 55 
Joined: Oct 2007 
 | 
| 
O.P.  [problem] Buttons in windows
 ok, so i made a window, i got help with that, but... 
 
i dont know how to make buttons do actions, such as close, open, navigate, stuff like that... 
 
Thanks In Advance. 
 |   
 | 
| 10-22-2007 08:40 PM | 
 | 
  | 
roflmao456 
Skinning Contest Winner 
    
  
  
 
Posts: 955 Reputation: 24 
31 /   /   
Joined: Nov 2006
 
Status: Away
 
 | 
 RE: [problem] Buttons in windows
code: function OnWindowidEvent_CtrlClicked(PlusWnd, ControlId){ 
switch(ControlId){ 
case "control-id-of-button": // when a button with this id is clicked.. 
PlusWnd.Close(1); // Closes the window 
break; 
case "control-id-of-another-button": 
Interop.Call("user32","MessageBoxW", 0, "Button 2 has been clicked", "some script", 64); // Displays a message box. 
break; 
} 
}
  
yeah so "PlusWnd.Close(1);" closes the window. 
replace "Windowid" with your window's ID.  
[quote]  
Ultimatess6: What a noob mod  
 |   
 | 
| 10-22-2007 09:41 PM | 
 | 
  | 
waynewilson2 
Junior Member 
  
  
  
 
Posts: 55 
Joined: Oct 2007 
 | 
| 
O.P.  RE: [problem] Buttons in windows
 TYVM roflmao, you seem to be able to help out alot...lmfao 
from now on, if i need help, imma talk to you first... 
 
oh, and another thing i was wondering about... how do i put textboxs and stuff like that in?? 
 This post was edited on 10-22-2007 at 11:06 PM by waynewilson2.
 |   
 | 
| 10-22-2007 11:01 PM | 
 | 
  | 
Spunky 
Former Super Mod 
     
  
  
 
Posts: 3656 Reputation: 61 
37 /   /   
Joined: Aug 2006 
 | 
| 
 RE: [problem] Buttons in windows
 For textboxes... change 
'Control type:xsi="ButtonControl"' 
 
to 
 
'Control type:xsi="EditControl"' 
 
in the xml file 
<Eljay> "Problems encountered: shit blew up"    
 |   
 | 
| 10-22-2007 11:22 PM | 
 | 
  | 
roflmao456 
Skinning Contest Winner 
    
  
  
 
Posts: 955 Reputation: 24 
31 /   /   
Joined: Nov 2006
 
Status: Away
 
 | 
 RE: [problem] Buttons in windows
quote: Originally posted by SpunkyLoveMuff 
For textboxes... change 
'Control type:xsi="ButtonControl"' 
 
to 
 
'Control type:xsi="EditControl"' 
 
in the xml file
  
and to get the text from the textbox (or other controls):
 code: Debug.Trace(PlusWnd.GetControlText("textbox-id-control"));
  
will pop up in your debug. 
[quote]  
Ultimatess6: What a noob mod  
 |   
 | 
| 10-23-2007 12:51 AM | 
 | 
  | 
waynewilson2 
Junior Member 
  
  
  
 
Posts: 55 
Joined: Oct 2007 
 | 
| 
O.P.  RE: [problem] Buttons in windows
 ok, thanks for that stuff, also, i just thought of sumthin else... how would i make it log the text within the box to a file? lol, im new to this crap, im good with other stuff, but unfortunately not that... 
 
the windows are the only thing i've had probs with so far... 
 This post was edited on 10-23-2007 at 05:30 AM by waynewilson2.
 |   
 | 
| 10-23-2007 05:29 AM | 
 | 
  | 
roflmao456 
Skinning Contest Winner 
    
  
  
 
Posts: 955 Reputation: 24 
31 /   /   
Joined: Nov 2006
 
Status: Away
 
 | 
 RE: [problem] Buttons in windows
quote: Originally posted by waynewilson2 
ok, thanks for that stuff, also, i just thought of sumthin else... how would i make it log the text within the box to a file? lol, im new to this crap, im good with other stuff, but unfortunately not that... 
 
the windows are the only thing i've had probs with so far...
  
http://www.tutorial-web.com/asp/fso/
i think it's 
 code: var fso = new ActiveXObject("Scripting.FileSystemObject"); 
var file = fso.OpenTextFile(MsgPlus.ScriptFilesPath + "\\log.txt",2,true); // will create log.txt in your script files path 
file.Write(PlusWnd.GetControlText("textbox-id"));
   
[quote]  
Ultimatess6: What a noob mod  
 |   
 | 
| 10-23-2007 08:13 PM | 
 | 
  | 
waynewilson2 
Junior Member 
  
  
  
 
Posts: 55 
Joined: Oct 2007 
 | 
| 
O.P.  RE: [problem] Buttons in windows
 ok TYVM...again lol 
 |   
 | 
| 10-23-2007 08:16 PM | 
 | 
  | 
waynewilson2 
Junior Member 
  
  
  
 
Posts: 55 
Joined: Oct 2007 
 | 
O.P.  RE: [problem] Buttons in windows
ok...new problem    when reading an array, how would i go about comparing that array to another string, kind of like a filtering system? lol
 
Thanks In Advance  
 |   
 | 
| 10-23-2007 08:49 PM | 
 | 
  | 
NanaFreak 
Scripting Contest Winner 
     
  
 
Posts: 1476 Reputation: 53 
33 /   /   
Joined: Jul 2006 
 | 
 RE: [problem] Buttons in windows
code: var Arr = new Array("123","456","789","456","abc","jkl","omn","456"); 
var Str = "456" 
for(i=0; i<Arr.length; i++){ 
if(Arr[i] == "456"){ 
Debug.Trace("Arr["+i+"] == 456"); 
} 
}
  
that should put this in the debug: 
Arr[1] == 456 
Arr[3] == 456 
Arr[7] == 456  
 |   
 | 
| 10-23-2007 08:54 PM | 
 | 
  | 
| 
Pages: (5): 
« First
  
 [ 1 ]
 2
 3
 4
 5
 
»
 
Last »
 | 
| 
 |