//--------------------------------------------------------- void CVIEW_Table_Control::On_LClick(wxGridEvent &event) { int iField = m_Field_Offset + event.GetCol(); CSG_Table_Record *pRecord = m_pRecords[event.GetRow()]; //----------------------------------------------------- if( event.AltDown() ) { if( m_pTable->Get_Field_Type(iField) == SG_DATATYPE_String ) { if( event.ControlDown() ) { g_pData->Open (pRecord->asString(iField)); } else { Open_Application(pRecord->asString(iField)); } } } //----------------------------------------------------- else if( event.ControlDown() ) { m_pTable->Select(pRecord, true); Update_Selection(); } else if( event.ShiftDown() ) { SelectBlock(event.GetRow(), 0, GetGridCursorRow(), GetNumberCols(), false); } else { SelectRow(event.GetRow(), false); if( pRecord && iField >= m_Field_Offset && iField < m_pTable->Get_Field_Count() && m_pTable->Get_Field_Type(iField) == SG_DATATYPE_Color ) { long lValue; if( DLG_Color(lValue = pRecord->asInt(iField)) ) { pRecord->Set_Value(iField, lValue); SetCellBackgroundColour(event.GetRow(), event.GetCol(), Get_Color_asWX(pRecord->asInt(iField))); ForceRefresh(); } } } //----------------------------------------------------- SetGridCursor(event.GetRow(), event.GetCol()); }
//--------------------------------------------------------- void CActive_Attributes_Control::On_LClick(wxGridEvent &event) { int iField = m_Field_Offset + event.GetCol(); CSG_Table_Record *pRecord = m_pTable->Get_Record(event.GetRow()); //----------------------------------------------------- if( event.AltDown() ) { if( m_pTable->Get_Field_Type(iField) == SG_DATATYPE_String ) { Open_Application(pRecord->asString(iField)); } } //----------------------------------------------------- if( event.ControlDown() ) { if( m_pTable->Get_Field_Type(iField) == SG_DATATYPE_String ) { g_pData->Open (pRecord->asString(iField)); } } //----------------------------------------------------- else { if( pRecord && iField >= m_Field_Offset && iField < m_pTable->Get_Field_Count() && m_pTable->Get_Field_Type(iField) == SG_DATATYPE_Color ) { long lValue; if( DLG_Color(lValue = pRecord->asInt(iField)) ) { pRecord->Set_Value(iField, lValue); SetCellBackgroundColour(event.GetRow(), event.GetCol(), Get_Color_asWX(pRecord->asInt(iField))); ForceRefresh(); } } } //----------------------------------------------------- SetGridCursor(event.GetRow(), event.GetCol()); }