AS3 ENTER_FRAME event still firing when frame changed
By : user2403448
Date : March 29 2020, 07:55 AM
Any of those help You can add an event listener to a MovieClip , but you shouldn't do it as a static function , like in your example. The following should work... code :
private var ui:StatsUI = new StatsUI();
public function view_stats(e:MouseEvent):void
{
// Event
ui.addEventListener(Event.ENTER_FRAME,stats_scroll);
}
public function view_stats_exit (e:MouseEvent):void
{
ui.removeEventListener(Event.ENTER_FRAME,stats_scroll);
view_start(null);
}
|
Text Changed Event Not Firing
By : desmondlo
Date : March 29 2020, 07:55 AM
I wish this help you 1. You need to set AutoPostBack property of the TextBox to True . 2. while comparing the input String with EmptyString, you need to Trim the input so that whitespaces would be removed. code :
<asp:TextBox ID="TxtComments" runat="server" OnTextChanged="TxtComments_TextChanged"
AutoPostBack="True"></asp:TextBox>
protected void TxtComments_TextChanged(object sender, EventArgs e)
{
if (TxtComments.Text.Trim().Equals(""))
{
LblErr.Text = "Please Enter a Comment!!!";
LblErr.Visible = true;
BtnSave.Enabled = false;
BtnSave.BackColor = Color.LightGray;
BtnSave.ForeColor = Color.Red;
}
else
{
BtnSave.Enabled = true;
BtnSave.BackColor = ColorTranslator.FromHtml("#666666");
BtnSave.ForeColor = Color.White;
}
}
protected void TxtComments_TextChanged(object sender, EventArgs e)
{
if (String.IsNullOrWhiteSpace(TxtComments.Text))
{
LblErr.Text = "Please Enter a Comment!!!";
LblErr.Visible = true;
BtnSave.Enabled = false;
BtnSave.BackColor = Color.LightGray;
BtnSave.ForeColor = Color.Red;
}
else
{
BtnSave.Enabled = true;
BtnSave.BackColor = ColorTranslator.FromHtml("#666666");
BtnSave.ForeColor = Color.White;
}
}
protected void BtnSave_Click(object sender, EventArgs e)
{
if (TxtComments.Text.Trim().Equals(""))
{
LblErr.Text = "Please Enter a Comment!!!";
LblErr.Visible = true;
BtnSave.Enabled = false;
BtnSave.BackColor = Color.LightGray;
BtnSave.ForeColor = Color.Red;
}
else if (DrpForYear.SelectedItem.Text == "Please Select" || DrpForMonth.SelectedItem.Text == "Please Select" || RadView.SelectedItem.Text == "")
{
LblErr.Text = "Invalid Selection!!!";
LblErr.Visible = true;
BtnSave.Enabled = false;
BtnSave.BackColor = Color.Gray;
BtnSave.ForeColor = Color.Red;
}
else
{
/*your code*/
}
}
|
ObservableCollection Collection Changed event not firing
By : user3487141
Date : March 29 2020, 07:55 AM
this will help When I run in to this the easiest way to solve it is just subscribe manually at the start. code :
public FTViewModel(int JobID)
{
_windowCloseAction = new DelegateCommand(OnWindowClose);
_oFTrn = new ObservableFilesTransmitted(_dataDc, JobID);
foreach(var item in _oFTrn)
{
item.PropertyChanged += FilesTransmitted_PropertyChanged;
}
_oFTrn.CollectionChanged += oFTrnCollectionChanged;
}
public FTViewModel(int JobID)
{
_windowCloseAction = new DelegateCommand(OnWindowClose);
_oFTrn = new ObservableFilesTransmitted(_dataDc, JobID);
_oFTrn.CollectionChanged += oFTrnListChanged;
}
void oFTrnListChanged(object sender, ListChangedEventArgs e)
{
if (e.ListChangedType == ListChangedType.ItemChanged)
{
if (e.PropertyDescriptor.Name == "DocumentNumber")
{
_filesTransmittedChange = true;
}
}
_refreshViews = true;
}
|
G_LOCK behavior changed from glib 2.46 to glib 2.48?
By : the_Promise_LAN
Date : March 29 2020, 07:55 AM
seems to work fine Firstly, all that G_LOCK_DEFINE does is create a GMutex variable, who's name encodes the name of the variable that it's protecting e.g. G_LOCK_DEFINE(mSomeCounter) becomes GMutex g__mSomeCounter_lock;. So we can expand your code to something like: code :
class CSomeClass {
private:
gulong mSomeCounter;
GMutex g__mSomeCounter_lock;
public:
CSomeClass ();
};
CSomeClass::CSomeClass()
{
g_mutex_lock(&g__mSomeCounter_lock);
mSomeCounter = 0;
g_mutex_unlock(&g__mSomeCounter_lock);
}
CSomeClass::CSomeClass() : mSomeCounter(0)
CSomeClass::CSomeClass()
{
g_mutex_init(&G_LOCK_NAME(mSomeCounter));
G_LOCK(mSomeCounter);
mSomeCounter = 0;
G_UNLOCK(mSomeCounter);
}
main() {
{ CSomeClass class1; }
{ CSomeClass class2; }
{ CSomeClass class3; }
}
class CGMutex {
GMutex mutex;
public:
CGMutex() {
g_mutex_init(&mutex);
}
~CGMutex() {
g_mutex_clear(&mutex);
}
GMutex *operator&() {
return &mutex;
}
};
class CGMutexLocker {
CGMutex &mRef;
public:
CGMutexLocker(CGMutex &mutex) : mRef(mutex) {
g_mutex_lock(&mRef);
}
~CGMutexLocker() {
g_mutex_unlock(&mRef);
}
};
class CSomeClass {
private:
gulong mSomeCounter;
CGMutex mSomeCounterLock;
public:
CSomeClass ();
};
CSomeClass::CSomeClass()
{
CGMutexLocker locker(mSomeCounterLock); // lock the mutex using the locker
mSomeCounter = 0;
}
|
WPF Text Changed Event Not Firing on 'S'
By : frnsh
Date : March 29 2020, 07:55 AM
I wish did fix the issue. I suspect that you've subscribed for the TextChanged event. If that is the case just subscribe for PreviewKeyDown, apply your filter and set e.Handled to true to sink it. code :
private void PreviewKeyDownFilter(object sender, KeyEventArgs e)
{
if (e.Key == Key.S && Keyboard.IsKeyDown(Key.LeftShift))
e.Handled = true;
}
|