What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Button_SetCheckState problem

Button_SetCheckState problem
Author: Message:
WarPenguin
New Member
*


Posts: 6
Joined: Mar 2008
O.P. RE: Button_SetCheckState problem
Here it is:

var AbreUm;
var AbreDois;
var AbreTres;
var SignIn;
var SignOut;
var Sound;

...(This functions have nothing to do with the options)

function OnEvent_MenuClicked(MenuItemId, Location, OriginWnd){
if(MenuItemId == "About"){
MsgPlus.CreateWnd("about.xml", "about");
}

if(MenuItemId == "Options"){
MsgPlus.CreateWnd("options.xml", "options");
ReadSettings("options");
}

}

function WriteSettings(PlusWnd){

Debug.Trace("Writing settings to file...");
var fso = new ActiveXObject("Scripting.FileSystemObject");
fso.CreateTextFile(MsgPlus.ScriptFilesPath + "\\Settings.txt",true);
var newfile = fso.OpenTextFile(MsgPlus.ScriptFilesPath + "\\Settings.txt",8,true);

if(PlusWnd.Button_IsChecked("Abreum") == true){
newfile.WriteLine("1");
}else{
newfile.WriteLine("0");
}

if(PlusWnd.Button_IsChecked("Abredois") == true){
newfile.WriteLine("1");
}else{
newfile.WriteLine("0");
}

if(PlusWnd.Button_IsChecked("Abretres") == true){
newfile.WriteLine("1");
}else{
newfile.WriteLine("0");
}

if(PlusWnd.Button_IsChecked("signIn") == true){
newfile.WriteLine("1");
}else{
newfile.WriteLine("0");
}

if(PlusWnd.Button_IsChecked("sound") == true){
newfile.WriteLine("1");
}else{
newfile.WriteLine("0");
}

if(PlusWnd.Button_IsChecked("signOut") == true){
newfile.WriteLine("1");
}else{
newfile.WriteLine("0");
}

newfile.Close();
}

function OnOptionsEvent_CtrlClicked(PlusWnd, ControlId){
if(ControlId == "BtnCancel"){
PlusWnd.Close(2);
}
if(ControlId == "OK"){
WriteSettings(PlusWnd);
PlusWnd.Close(1);
}
}

function ReadSettings(optionsWnd){
Debug.Trace("Reading settings from file...");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var newfile = fso.OpenTextFile(MsgPlus.ScriptFilesPath + "\\Settings.txt",1,true);

Debug.Trace(typeof optionsWnd);
Debug.Trace(optionsWnd.Handle);
if(newfile.Readline() == 1){
AbreUm = true;
optionsWnd.Button_SetCheckState("Abreum",AbreUm);
}else{
AbreUm = false;
optionsWnd.Button_SetCheckState("Abreum",AbreUm);
}

if(newfile.Readline() == 1){
AbreDois = true;
optionsWnd.Button_SetCheckState("Abredois",AbreDois);
}else{
AbreDois = false;
optionsWnd.Button_SetCheckState("Abredois",AbreDois);
}

if(newfile.Readline() == 1){
AbreTres = true;
optionsWnd.Button_SetCheckState("Abretres",AbreTres);
}else{
AbreTres = false;
optionsWnd.Button_SetCheckState("Abretres",AbreTres);
}

if(newfile.Readline() == 1){
SignIn = true;
optionsWnd.Button_SetCheckState("signIn",SignIn);
}else{
SignIn = false;
optionsWnd.Button_SetCheckState("signIn",SignIn);
}

if(newfile.Readline() == 1){
Sound = true;
optionsWnd.Button_SetCheckState("sound", Sound);
}else{
Sound = false;
optionsWnd.Button_SetCheckState("sound", Sound);
}

if(newfile.Readline() == 1){
SignOut = true;
optionsWnd.Button_SetCheckState("signOut", SignOut);
}else{
SignOut = false;
optionsWnd.Button_SetCheckState("signOut", SignOut);
}
newfile.Close();
}
03-12-2008 06:10 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Button_SetCheckState problem - by WarPenguin on 03-12-2008 at 05:41 PM
RE: Button_SetCheckState problem - by Spunky on 03-12-2008 at 05:47 PM
RE: Button_SetCheckState problem - by WarPenguin on 03-12-2008 at 05:57 PM
RE: Button_SetCheckState problem - by matty on 03-12-2008 at 05:58 PM
RE: Button_SetCheckState problem - by WarPenguin on 03-12-2008 at 06:00 PM
RE: Button_SetCheckState problem - by matty on 03-12-2008 at 06:01 PM
RE: Button_SetCheckState problem - by WarPenguin on 03-12-2008 at 06:05 PM
RE: Button_SetCheckState problem - by matty on 03-12-2008 at 06:06 PM
RE: Button_SetCheckState problem - by WarPenguin on 03-12-2008 at 06:10 PM
RE: Button_SetCheckState problem - by matty on 03-12-2008 at 06:15 PM
RE: Button_SetCheckState problem - by WarPenguin on 03-12-2008 at 06:20 PM
RE: Button_SetCheckState problem - by matty on 03-12-2008 at 06:25 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On