本文整理匯總了C++中EnableOK函數的典型用法代碼示例。如果您正苦於以下問題:C++ EnableOK函數的具體用法?C++ EnableOK怎麽用?C++ EnableOK使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EnableOK函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: GetName
void dlgExtTable::CheckChange()
{
wxString name = GetName();
if(!name.IsEmpty())
{
if (extTable)
EnableOK(txtComment->GetValue() != extTable->GetComment()
|| txtSqlBox->GetText() != oldDefinition
|| cbOwner->GetValue() != extTable->GetOwner()
|| name != extTable->GetName());
else
EnableOK(!txtComment->GetValue().IsEmpty()
|| !txtSqlBox->GetText().IsEmpty()
|| !cbOwner->GetValue().IsEmpty());
}
else
{
bool enable = true;
CheckValid(enable, !name.IsEmpty(), _("Please specify name."));
CheckValid(enable, txtSqlBox->GetText().Length() > 0 , _("Please enter external table definition."));
EnableOK(enable);
}
}
示例2: EnableOK
int dlgRepSubscription::Go(bool modal)
{
txtOrigin->SetValue(NumToStr(set->GetOriginId()));
if (subscription)
{
// edit mode
chkForward->SetValue(subscription->GetForward());
txtReceiver->SetValue(IdAndName(subscription->GetReceiverId(), subscription->GetReceiverNode()));
}
else
{
// create mode
txtReceiver->SetValue(IdAndName(cluster->GetLocalNodeID(), cluster->GetLocalNodeName()));
if (cluster->ClusterMinimumVersion(1, 1))
{
// This is very ugly: starting with Slony-I 1.1, this must be called on the provider,
// not on the receiver.
stProvider->SetLabel(_("Receiver"));
stReceiver->SetLabel(_("Provider"));
}
}
if (set->GetOriginId() == cluster->GetLocalNodeID() && subscription)
{
chkForward->SetValue(subscription->GetForward());
cbProvider->Append(IdAndName(subscription->GetProviderId(), subscription->GetProviderNode()));
cbProvider->SetSelection(0);
cbProvider->Disable();
chkForward->Disable();
EnableOK(false);
}
else
{
pgSet *sets = connection->ExecuteSet(
wxT("SELECT no_id, no_comment\n")
wxT(" FROM ") + cluster->GetSchemaPrefix() + wxT("sl_node\n")
wxT(" WHERE no_active AND no_id <> ") + NumToStr(cluster->GetLocalNodeID()));
if (sets)
{
while (!sets->Eof())
{
cbProvider->Append(IdAndName(sets->GetLong(wxT("no_id")), sets->GetVal(wxT("no_comment"))),
(void*)sets->GetLong(wxT("no_id")));
if (subscription && sets->GetLong(wxT("no_id")) == subscription->GetProviderId())
cbProvider->SetSelection(cbProvider->GetCount()-1);
sets->MoveNext();
}
delete sets;
}
}
if (!subscription && cbProvider->GetCount())
{
cbProvider->SetSelection(0);
EnableOK(true);
}
return dlgProperty::Go(modal);
}
示例3: GetName
void dlgEventTrigger::CheckChange()
{
bool enable = true;
wxString function = cbFunction->GetValue();
wxString name = GetName();
wxString owner = cbOwner->GetValue();
(chkEnable->GetValue()) ? rdbEnableStatus->Enable() : rdbEnableStatus->Disable();
CheckValid(enable, !name.IsEmpty(), _("Please specify event trigger name."));
CheckValid(enable, !owner.IsEmpty(), _("Please specify owner of event trigger."));
CheckValid(enable, !function.IsEmpty(), _("Please specify event trigger function."));
if (eventTrigger)
{
EnableOK(enable &&
(txtComment->GetValue() != eventTrigger->GetComment() ||
txtName->GetValue() != eventTrigger->GetName() ||
txtWhen->GetValue() != eventTrigger->GetWhen() ||
chkEnable->GetValue() != eventTrigger->GetEnabled() ||
rdbEvents->GetStringSelection().Lower() != eventTrigger->GetEventName().Lower() ||
rdbEnableStatus->GetStringSelection().Lower() != eventTrigger->GetEnableStatus().Lower() ||
!function.IsEmpty() ||
!owner.IsEmpty()
)
);
}
else
{
EnableOK(enable);
}
}
示例4: EnableOK
void dlgRepTable::CheckChange()
{
if (table)
{
bool tgChanged = false;
unsigned int i;
int cnt = 0;
for (i = 0 ; !tgChanged && i < chkTrigger->GetCount() ; i++)
{
if (chkTrigger->IsChecked(i))
{
cnt++;
if (table->GetTriggers().Index(chkTrigger->GetString(i)) < 0)
tgChanged = true;
}
}
EnableOK(tgChanged
|| (int)table->GetTriggers().GetCount() != cnt
|| txtComment->GetValue() != table->GetComment());
}
else
{
bool enable = true;
CheckValid(enable, cbTable->GetGuessedSelection() >= 0, _("Please select table to replicate."));
CheckValid(enable, cbIndex->GetCurrentSelection() >= 0, _("Please select index."));
EnableOK(enable);
}
}
示例5: GetName
void dlgFunction::CheckChange()
{
wxString name = GetName();
bool isC = cbLanguage->GetValue().IsSameAs(wxT("C"), false);
bool enable = true, didChange = true;
CheckValid(enable, !name.IsEmpty(), _("Please specify name."));
if (!isProcedure)
CheckValid(enable, cbReturntype->GetValue().Trim() != wxEmptyString, _("Please select return type."));
if (!(isProcedure && connection->GetIsEdb()))
CheckValid(enable, cbLanguage->GetGuessedSelection() >= 0, _("Please select language."));
if (isC)
{
wxString objfile = txtObjectFile->GetValue();
CheckValid(enable, !objfile.IsEmpty() && objfile != TXTOBJ_LIB, _("Please specify object library."));
}
else
{
CheckValid(enable, !txtSqlBox->GetText().IsEmpty(), _("Please enter function source code."));
}
if (function && enable)
{
if (seclabelPage && connection->BackendMinimumVersion(9, 1))
enable = enable || !(seclabelPage->GetSqlForSecLabels().IsEmpty());
EnableOK(enable && !GetSql().IsEmpty());
}
else
{
EnableOK(enable && didChange);
}
}
示例6: CheckValid
void dlgRole::CheckChange()
{
bool timEn=datValidUntil->GetValue().IsValid();
timValidUntil->Enable(timEn);
if (!timEn)
timValidUntil->SetTime(wxDefaultDateTime);
if (!readOnly)
chkUpdateCat->Enable(chkSuperuser->GetValue());
// Check the passwords match
if (txtPasswd->GetValue() != txtRePasswd->GetValue())
{
bool enable=true;
CheckValid(enable, false, _("The passwords entered do not match!"));
EnableOK(enable);
return;
}
if (!role)
{
wxString name=GetName();
bool enable=true;
CheckValid(enable, !name.IsEmpty(), _("Please specify name."));
EnableOK(enable);
}
else
{
EnableOK(!GetSql().IsEmpty());
}
}
示例7: EnableOK
void dlgRepCluster::CheckChange()
{
if (cluster)
{
int sel = cbAdminNode->GetCurrentSelection();
bool changed = (sel >= 0 && (long)cbAdminNode->wxEvtHandler::GetClientData() != cluster->GetAdminNodeID());
EnableOK(changed || txtComment->GetValue() != cluster->GetComment());
}
else
{
size_t i;
bool enable = true;
CheckValid(enable, chkJoinCluster->GetValue() || (!createScript.IsEmpty()),
_("Slony-I creation scripts not available; only joining possible."));
if (chkJoinCluster->GetValue())
CheckValid(enable, !cbClusterName->GetValue().IsEmpty(), _("Please select a cluster name."));
else
CheckValid(enable, !txtClusterName->GetValue().IsEmpty(), _("Please specify name."));
long nodeId = StrToLong(txtNodeID->GetValue());
CheckValid(enable, nodeId > 0, _("Please specify local node ID."));
for (i = 0 ; i < usedNodes.GetCount() && enable; i++)
CheckValid(enable, nodeId != usedNodes[i], _("Node ID is already in use."));
CheckValid(enable, !txtNodeName->GetValue().IsEmpty(), _("Please specify local node name."));
txtAdminNodeName->Enable(nodeId != StrToLong(txtAdminNodeID->GetValue()));
EnableOK(enable);
}
}
示例8: StrToLong
void dlgColumn::CheckChange()
{
bool enable = true;
long varlen = StrToLong(txtLength->GetValue()),
varprec = StrToLong(txtPrecision->GetValue());
if (column)
{
txtPrecision->Enable(column->GetTable()->GetMetaType() != PGM_VIEW && isVarPrec && varlen > 0);
CheckValid(enable, cbDatatype->GetGuessedSelection() >= 0, _("Please select a datatype."));
if (!connection->BackendMinimumVersion(7, 5))
{
CheckValid(enable, !isVarLen || !txtLength->GetValue().IsEmpty() || varlen >= column->GetLength(),
_("New length must not be less than old length."));
CheckValid(enable, !txtPrecision->IsEnabled() || varprec >= column->GetPrecision(),
_("New precision must not be less than old precision."));
CheckValid(enable, !txtPrecision->IsEnabled() || varlen - varprec >= column->GetLength() - column->GetPrecision(),
_("New total digits must not be less than old total digits."));
}
if (enable)
enable = GetName() != column->GetName()
|| txtDefault->GetValue() != column->GetDefault()
|| txtComment->GetValue() != column->GetComment()
|| chkNotNull->GetValue() != column->GetNotNull()
|| (cbDatatype->GetCount() > 1 && cbDatatype->GetGuessedStringSelection() != column->GetRawTypename() && !column->GetIsArray())
|| (cbDatatype->GetCount() > 1 && cbDatatype->GetGuessedStringSelection() != column->GetRawTypename() + wxT("[]") && column->GetIsArray())
|| (!cbCollation->GetValue().IsEmpty() && cbCollation->GetValue() != column->GetCollation())
|| (isVarLen && varlen != column->GetLength())
|| (isVarPrec && varprec != column->GetPrecision())
|| txtAttstattarget->GetValue() != NumToStr(column->GetAttstattarget())
|| cbStorage->GetValue() != column->GetStorage()
|| dirtyVars;
if (seclabelPage && connection->BackendMinimumVersion(9, 1))
enable = enable || !(seclabelPage->GetSqlForSecLabels().IsEmpty());
EnableOK(enable || securityChanged);
}
else
{
txtPrecision->Enable(isVarPrec && varlen > 0);
wxString name = GetName();
CheckValid(enable, !name.IsEmpty(), _("Please specify name."));
CheckValid(enable, cbDatatype->GetGuessedSelection() >= 0, _("Please select a datatype."));
CheckValid(enable, !isVarLen || txtLength->GetValue().IsEmpty()
|| (varlen >= minVarLen && varlen <= maxVarLen && NumToStr(varlen) == txtLength->GetValue()),
_("Please specify valid length."));
CheckValid(enable, !txtPrecision->IsEnabled()
|| (varprec >= 0 && varprec <= varlen && NumToStr(varprec) == txtPrecision->GetValue()),
_("Please specify valid numeric precision (0..") + NumToStr(varlen) + wxT(")."));
EnableOK(enable);
}
}
示例9: EnableOK
void frmGrantWizard::OnChange(wxCommandEvent &event)
{
sqlPane->SetReadOnly(false);
sqlPane->SetText(GetSql());
sqlPane->SetReadOnly(true);
if (sqlPane->GetText().IsEmpty())
EnableOK(false);
else
EnableOK(true);
}
示例10: EnableOK
void dlgRepNode::CheckChange()
{
if (node)
{
EnableOK(txtComment->GetValue() != node->GetComment());
}
else
{
bool enable = true;
EnableOK(enable);
}
}
示例11: EnableOK
void dlgRepSet::CheckChange()
{
if (set)
{
EnableOK(txtComment->GetValue() != set->GetComment());
}
else
{
bool enable = (!txtComment->IsEmpty());
EnableOK(enable);
}
}
示例12: EnableOK
void dlgRepSequence::CheckChange()
{
if (sequence)
{
EnableOK(txtComment->GetValue() != sequence->GetComment());
}
else
{
bool enable = true;
CheckValid(enable, cbSequence->GetGuessedSelection() >= 0, _("Please select sequence to replicate."));
EnableOK(enable);
}
}
示例13: EnableOK
void GenerateDlg::OnStart(wxCommandEvent& evt)
{
prjFrame->GenerateStarted();
EnableOK(0, 0);
ed->AppendText("---------- Start ----------\r\n");
canceled = 0;
paused = 0;
int sel = rateWnd->GetCurrentSelection();
if (sel != wxNOT_FOUND)
updateRate = (long) rateWnd->GetClientData(sel);
if (!genAuto)
{
playFrom = GetTimeValue("IDC_PLAY_FROM");
playTo = GetTimeValue("IDC_PLAY_TO");
}
if (playSome)
{
theProject->StartTime(playFrom);
theProject->EndTime(playTo);
startTime = playFrom;
}
else
{
theProject->StartTime(0);
theProject->EndTime(0);
startTime = 0;
}
lastTime = 0;
theProject->PlayMode(playLive);
lastMsg = "";
FormatTime("IDC_TIME", startTime);
tml->Reset();
lpkMtr->Reset();
rpkMtr->Reset();
lftPeak = 0;
rgtPeak = 0;
lftMax = 0;
rgtMax = 0;
FormatPeak();
prjGenerate = static_cast<GenerateWindow*>(this);
theProject->CallbackRate((float)updateRate / 10.0f);
if (theProject->Start() == 0)
EnableOK(0, 1);
else
EnableOK(1, 0);
}
示例14: EnableOK
void dlgIndexBase::CheckChange()
{
if (index)
{
EnableOK(txtComment->GetValue() != index->GetComment() ||
cbTablespace->GetOIDKey() != index->GetTablespaceOid());
}
else
{
bool enable=true;
txtComment->Enable(!GetName().IsEmpty());
CheckValid(enable, lstColumns->GetItemCount() > 0, _("Please specify columns."));
EnableOK(enable);
}
}
示例15: VERIFY
BOOL CExportDlg::OnInitDialog()
{
CDialog::OnInitDialog();
VERIFY(m_taskSel.Create(IDC_FRAME, this));
// set initial control states
GetDlgItem(IDC_TASKLISTOPTIONS)->EnableWindow(!m_bSingleTaskList);
GetDlgItem(IDC_EXPORTONEFILE)->EnableWindow(!m_bSingleTaskList && m_nExportOption == ALLTASKLISTS);
m_eExportPath.SetFilter(m_mgrImportExport.GetExporterFileFilter(s_nFormatOption));
m_eExportPath.EnableStyle(FES_FOLDERS, (m_nExportOption == ALLTASKLISTS && !m_bExportOneFile));
// build the format comboxbox
for (int nExp = 0; nExp < m_mgrImportExport.GetNumExporters(); nExp++)
{
m_cbFormat.AddString(m_mgrImportExport.GetExporterMenuText(nExp));
}
m_cbFormat.SetCurSel(s_nFormatOption);
m_eExportPath.EnableWindow(m_mgrImportExport.ExporterHasFileExtension(s_nFormatOption));
EnableOK();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}