Ejemplo n.º 1
0
void CorrelParamsFrame::UpdateVarChoiceFromTable(const wxString& default_var)
{
	TableInterface* table_int = project->GetTableInt();
	if (!table_int || !var_choice) return;

	int var_pos = -1;
	var_choice->Clear();
    name_to_nm.clear();
    
    int idx = -1;
    std::vector<int> col_id_map;
    table_int->FillNumericColIdMap(col_id_map);
    for (int i=0, iend=col_id_map.size(); i<iend; i++) {
        int id = col_id_map[i];
        wxString name = table_int->GetColName(id);
        if (table_int->IsColTimeVariant(id)) {
            wxString nm = name;
            nm << " (" << table_int->GetTimeString(v1_time) << ")";
            name_to_nm[nm] = name;
            var_choice->Append(nm);
            idx++;
        } else {
            var_choice->Append(name);
            name_to_nm[name] = name;
            idx++;
        }
        if (name == default_var) var_pos = idx;
    }
    
    if (var_pos >= 0) {
        var_choice->SetSelection(var_pos);
    }
    
	UpdateApplyState();
}
Ejemplo n.º 2
0
BOOL LayerPropertiesTab::HandleMsg(DialogMsg* Msg)
{
TRACEUSER( "Neville", _T("LayerPropertiesTab::HandleMsg\n"));
	ERROR2IF(Msg == NULL,FALSE,"LayerPropertiesTab::Message null message received");
	ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::HandleMsg called with no dialog pointer");

	BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
	if (!ok)
		return TRUE;		// no page present = handled message
	
	switch(Msg->DlgMsg)
	{
		case DIM_CREATE:	// Initialise controls
			GreyStatus = FALSE;	// we are ungreyed by default
			ok = InitSection();
			if (!ok)
				InformError();
			break;
		case DIM_LFT_BN_CLICKED:
		{
			UpdateApplyState();
			//switch (Msg->GadgetID)
			//{
			//}
		}
		break;

		case DIM_SELECTION_CHANGED:
		case DIM_TEXT_CHANGED:
			UpdateApplyState();
			break;

		default:
			break;
	}
	return TRUE;
}  
Ejemplo n.º 3
0
void CorrelParamsFrame::UpdateVarChoiceFromTable(const wxString& default_var)
{
	TableInterface* table_int = project->GetTableInt();
	if (!table_int || !var_choice) return;

	int var_pos = -1;
	var_choice->Clear();
	std::vector<wxString> names;
	table_int->FillNumericNameList(names);
	for (size_t i=0, sz=names.size(); i<sz; ++i) {
		var_choice->Append(names[i]);
		if (names[i] == default_var) var_pos = i;
	}
    
	if (var_pos >= 0) {
		var_choice->SetSelection(var_pos);
	}
	UpdateApplyState();
}