[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/feed.php on line 173: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/feed.php on line 174: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
XWidgetSoft Forum XWidget & XLaunchpad , Desktop customization 2016-02-25T03:12:21-08:00 https://bbs.xwidget.com/feed.php?f=8&t=6199 2016-02-25T03:12:21-08:00 2016-02-25T03:12:21-08:00 https://bbs.xwidget.com/viewtopic.php?t=6199&p=13129#p13129 <![CDATA[Re: Play 2 sounds/mute]]> Statistics: Posted by Jimking — February 25th, 2016, 3:12 am


]]>
2016-02-23T08:48:06-08:00 2016-02-23T08:48:06-08:00 https://bbs.xwidget.com/viewtopic.php?t=6199&p=13124#p13124 <![CDATA[Re: Play 2 sounds/mute]]> Statistics: Posted by yereverluvinuncleber — February 23rd, 2016, 8:48 am


]]>
2016-02-23T08:07:28-08:00 2016-02-23T08:07:28-08:00 https://bbs.xwidget.com/viewtopic.php?t=6199&p=13123#p13123 <![CDATA[Re: Play 2 sounds/mute]]> Statistics: Posted by Jimking — February 23rd, 2016, 8:07 am


]]>
2016-02-23T08:00:29-08:00 2016-02-23T08:00:29-08:00 https://bbs.xwidget.com/viewtopic.php?t=6199&p=13122#p13122 <![CDATA[Re: Play 2 sounds/mute]]> Statistics: Posted by yereverluvinuncleber — February 23rd, 2016, 8:00 am


]]>
2016-02-23T06:31:56-08:00 2016-02-23T06:31:56-08:00 https://bbs.xwidget.com/viewtopic.php?t=6199&p=13121#p13121 <![CDATA[Re: Play 2 sounds/mute]]> Statistics: Posted by Jimking — February 23rd, 2016, 6:31 am


]]>
2016-02-23T05:51:26-08:00 2016-02-23T05:51:26-08:00 https://bbs.xwidget.com/viewtopic.php?t=6199&p=13120#p13120 <![CDATA[Re: Play 2 sounds/mute]]>


Note: Xwidget menu options cannot be built dynamically in code so you just have to create the menus statically by hand in the designer..

Then it is a matter of assigning a function to each menu option incorporating the command playsound. As the Xwidget engine cannot handle the playing of more than one sound simultaneously, playing one sound will automatically mute the other. In this case this suits your requirement. The third menu option can play a blank wav file to mute any currently running sound. When the mute option is chosen, subsequently decide either to avoid using the playsound command or simply play a null sound instead.

One method of saving your prefs is done by having a hidden layer containing hidden text or memo boxes - see my U-Boat widget for how I typically do it.

Each text box is named as a preference variable according to its function.
My hidden prefs layer is called: showWidgetPreferences
My text boxes are named as such: preferencesHintPrefValue - this naming convention allows easy conversion to a yahoo widget which uses the following naming convention : preferences.hintPref.value .

The function getprefs is called when the widget starts:

//===========================================
// this function runs on startup
//===========================================
function widgetOnLoad() {
getPrefs();
}

//=========================================================================
// this function sets the preference values to saved values
//=========================================================================
function getPrefs(){
preferenceshoffsetprefvalue.text = Getinivalue(widgetpath+"prefs.ini","prefs","preferenceshoffsetprefvalue","350");
preferencesvoffsetprefvalue.text = Getinivalue(widgetpath+"prefs.ini","prefs","preferencesvoffsetprefvalue","350");
preferenceswidgetTooltipvalue.text = Getinivalue(widgetpath+"prefs.ini","prefs","preferenceswidgetTooltipvalue","Double-Click on me to set the widget command");
preferencesimageCmdPrefvalue.text = Getinivalue(widgetpath+"prefs.ini","prefs","preferencesimageCmdPrefvalue","");
print("preferencesclockSizevalue.percent "+preferencesclockSizevalue.percent);
preferencessoundprefvalue.text = Getinivalue(widgetpath+"prefs.ini","prefs","preferencessoundprefvalue","enabled");
preferencesclockSizevalue.percent = Getinivalue(widgetpath+"prefs.ini","prefs","preferencesclockSizevalue","100");
preferencesLicenceHideValue.text = Getinivalue(widgetpath+"prefs.ini","prefs","preferencesLicenceHideValue",0);
preferencesMouseWheelPrefValue.text = Getinivalue(widgetpath+"prefs.ini","prefs","preferencesMouseWheelPrefValue","up");
preferencesHintPrefValue.text = Getinivalue(widgetpath+"prefs.ini","prefs","preferencesHintPrefValue","enabled");
preferencesclockFaceSwitchPrefvalue.text = Getinivalue(widgetpath+"prefs.ini","prefs","preferencesclockFaceSwitchPrefvalue","stopwatch");
preferenceswidgetLockLandscapeModePrefvalue .text = Getinivalue(widgetpath+"prefs.ini","prefs","preferenceswidgetLockLandscapeModePrefvalue","enabled");

print("preferencesHintPrefValue.text "+preferencesHintPrefValue.text);

if (preferencessoundprefvalue.text != "disabled") {
soundbutton.src="bellpushed.png"; // this in place of a checkbutton which I could not get to work correctly
} else {
soundbutton.src="bell.png";
}
PlaySound(soundbutton);
}
//=====================
//End function
//=====================

As soon as the above function is called it plays a sound according to the value set in one of the prefs.

//=========================================================================
// this function saves the preferences to an ini file for later use
//=========================================================================
function SavePrefs()
{
print ("Saving Prefs ");
Setinivalue(widgetpath+"prefs.ini","prefs","preferenceshoffsetprefvalue",preferenceshoffsetprefvalue.text);
Setinivalue(widgetpath+"prefs.ini","prefs","preferencesvoffsetprefvalue",preferencesvoffsetprefvalue.text);
Setinivalue(widgetpath+"prefs.ini","prefs","preferenceswidgetTooltipvalue",preferenceswidgetTooltipvalue.text);
//print("preferencesimageCmdPrefvalue.text "+preferencesimageCmdPrefvalue.text);
Setinivalue(widgetpath+"prefs.ini","prefs","preferencesimageCmdPrefvalue",preferencesimageCmdPrefvalue.text);
Setinivalue(widgetpath+"prefs.ini","prefs","preferencessoundprefvalue",preferencessoundprefvalue.text);
Setinivalue(widgetpath+"prefs.ini","prefs","preferencesclockSizevalue",preferencesclockSizevalue.percent);
Setinivalue(widgetpath+"prefs.ini","prefs","preferencesLicenceHideValue",preferencesLicenceHideValue.text);
Setinivalue(widgetpath+"prefs.ini","prefs","preferencesMouseWheelPrefValue",preferencesMouseWheelPrefValue.text);
Setinivalue(widgetpath+"prefs.ini","prefs","preferencesHintPrefValue",preferencesHintPrefValue.text);
Setinivalue(widgetpath+"prefs.ini","prefs","preferencesclockFaceSwitchPrefvalue",preferencesclockFaceSwitchPrefvalue.text);
Setinivalue(widgetpath+"prefs.ini","prefs","preferenceswidgetLockLandscapeModePrefvalue",preferenceswidgetLockLandscapeModePrefvalue.text);


print("preferencesHintPrefValue.text "+preferencesHintPrefValue.text);

}
//=====================
//End function
//=====================


This shows how I get settings from an ini file and how I save them too. Sometimes I have to create the ini file manually the first time they are used. My hidden prefs layer can be made visible on request so I have a nice and pretty underlying image that holds the text boxes and descriptions. This allows you to view all the fields and change the preferences they hold manually. I make the preferences layer visible from the right click menu using a menu option named "Show Preferences" that runs this command showWidgetPreferences.visible = true; to make the layer and all the contained objects visible.



This is taken directly from the style of the konfabulator/Yahoo widget engine that has built-in functionality to provide a GUI for the storage and handling of preferences. I have my own radio boxes showing here as I had problems making the Xwidget engine's radio buttons work the way I wanted them to.

Statistics: Posted by yereverluvinuncleber — February 23rd, 2016, 5:51 am


]]>
2016-02-23T03:30:13-08:00 2016-02-23T03:30:13-08:00 https://bbs.xwidget.com/viewtopic.php?t=6199&p=13119#p13119 <![CDATA[Play 2 sounds/mute]]> I have two sounds (wav) and I want to use two right click options to play each one separately (on/off). Like this:

(right click options)
sound 1 on/off (checked/unchecked)
sound 2 on/off (checked/unchecked)

- When the sound 1 will play the sound 2 will mute. Conversely for the sound 2.
- 3rd option to mute both (all sounds)
- save ini for the sound status

Thanks in advance :)

Statistics: Posted by Jimking — February 23rd, 2016, 3:30 am


]]>