void CuEditableListCtrlGeneric::OnRButtonDown(UINT nFlags, CPoint point) { int index, iColumnNumber = 1; int iItem = -1, iSubItem = -1; int iNumMin = 0; int iNumMax = 400; CRect rect, rCell; UINT flags; index = HitTest (point, &flags); if (index < 0) return; GetItemRect (index, rect, LVIR_BOUNDS); if (!GetCellRect (rect, point, rCell, iColumnNumber)) return; if (rect.PtInRect (point)) CuListCtrl::OnRButtonDown(nFlags, point); rCell.top -= 2; rCell.bottom += 2; HideProperty(); if (iColumnNumber != 1) return; EditValue (index, iColumnNumber, rCell); }
void CamSettingsPage::OnAbsModeClicked( Gtk::CheckButton* pButton ) { m_absMode = pButton->get_active(); // Refresh the unit label and spin buttons // The rest of the widgets don't need to be updated for ( unsigned int i = 0; i < sk_numProps; i++ ) { if ( m_pCamera == 0 ) { return; } Gtk::SpinButton* pSpin1 = m_widgetPropArray[i].pSpinButton1; Gtk::SpinButton* pSpin2 = m_widgetPropArray[i].pSpinButton2; Gtk::Label* pLabel1 = m_widgetPropArray[i].pLabel1; Gtk::Label* pLabel2 = m_widgetPropArray[i].pLabel2; const PropertyType k_currPropType = (PropertyType)i; Property camProp; PropertyInfo camPropInfo; // Get the property and property info camProp.type = k_currPropType; camPropInfo.type = k_currPropType; if ( m_pCamera->GetProperty( &camProp ) != PGRERROR_OK || m_pCamera->GetPropertyInfo( &camPropInfo ) != PGRERROR_OK ) { // Perhaps not supported, hide it and continue HideProperty( k_currPropType ); continue; } if ( pLabel1 != 0 ) { UpdateLabel( pLabel1, &camPropInfo, &camProp ); } if ( pLabel2 != 0 ) { UpdateLabel( pLabel2, &camPropInfo, &camProp ); } if ( pSpin1 != 0 ) { UpdateSpinButton( pSpin1, &camPropInfo ); } if ( pSpin2 != 0 ) { UpdateSpinButton( pSpin2, &camPropInfo ); } } UpdateWidgets(); }
void CuEditableListCtrlComponent::OnOpenCellEditor(UINT nFlags, CPoint point) { int index, iColumnNumber; int iItem = -1, iSubItem = -1; int iNumMin = 0; int iNumMax = UD_MAXVAL; CRect rect, rCell; UINT flags; index = HitTest (point, &flags); if (index < 0) return; GetItemRect (index, rect, LVIR_BOUNDS); if (!GetCellRect (rect, point, rCell, iColumnNumber)) return; rCell.top -= 2; rCell.bottom += 2; // Emb Sept 24, 97: modify for preliminary test at low level side CuCbfListViewItem* pItemData = (CuCbfListViewItem*)GetItemData(index); LPCOMPONENTINFO lpComponentInfo = &pItemData->m_componentInfo; BOOL bCanEditName = VCBFllCanNameBeEdited(lpComponentInfo); BOOL bCanEditCount = VCBFllCanCountBeEdited(lpComponentInfo); HideProperty(); switch (iColumnNumber) { case 1: if (bCanEditName) SetEditText (index, iColumnNumber, rCell); else MessageBeep(MB_ICONEXCLAMATION); break; case 2: if (bCanEditCount) SetEditSpin (index, iColumnNumber, rCell, iNumMin, iNumMax); else MessageBeep(MB_ICONEXCLAMATION); break; default: break; } }
void CuEditableListCtrlDuplicateDbSelectLocation::OnLButtonDblClk(UINT nFlags, CPoint point) { int index, iColumnNumber; int iItem = -1, iSubItem = -1; int iNumMin = 0; int iNumMax = 400; CRect rect, rCell; UINT flags; index = HitTest (point, &flags); if (index < 0) return; GetItemRect (index, rect, LVIR_BOUNDS); if (!GetCellRect (rect, point, rCell, iColumnNumber)) return; rCell.top -= 2; rCell.bottom += 2; HideProperty(); EditValue (index, iColumnNumber, rCell); }
void CamSettingsPage::UpdateWidgets() { Glib::Mutex::Lock updateLock( m_updateWidgetMutex, Glib::NOT_LOCK ); if ( updateLock.try_acquire() != true ) { return; } if ( m_pCamera == NULL || IsConnected() != true ) { return; } UpdateCameraPowerCheckButton(); if ( m_absMode != m_pCheckbuttonAbsMode->get_active() ) { m_pCheckbuttonAbsMode->set_active( m_absMode ); } for ( unsigned int i = 0; i < sk_numProps; i++ ) { if ( m_pCamera == 0 ) { return; } Gtk::CheckButton* pAuto = m_widgetPropArray[i].pAuto; Gtk::CheckButton* pOnOff = m_widgetPropArray[i].pOnOff; Gtk::CheckButton* pOnePush = m_widgetPropArray[i].pOnePush; Gtk::HScale* pHScale1 = m_widgetPropArray[i].pHScale1; Gtk::HScale* pHScale2 = m_widgetPropArray[i].pHScale2; Gtk::SpinButton* pSpinButton1 = m_widgetPropArray[i].pSpinButton1; Gtk::SpinButton* pSpinButton2 = m_widgetPropArray[i].pSpinButton2; Gtk::Adjustment* pAdjustment1 = m_widgetPropArray[i].pAdjustment1; Gtk::Adjustment* pAdjustment2 = m_widgetPropArray[i].pAdjustment2; Gtk::Label* pLabel1 = m_widgetPropArray[i].pLabel1; Gtk::Label* pLabel2 = m_widgetPropArray[i].pLabel2; const PropertyType k_currPropType = (PropertyType)i; Property camProp; PropertyInfo camPropInfo; // Get the property and property info camProp.type = k_currPropType; camPropInfo.type = k_currPropType; Error getPropErr = m_pCamera->GetProperty( &camProp ); Error getPropInfoErr = m_pCamera->GetPropertyInfo( &camPropInfo ); if ( getPropErr != PGRERROR_OK || getPropInfoErr != PGRERROR_OK || camPropInfo.present == false) { // Perhaps not supported, hide it and continue HideProperty( k_currPropType ); continue; } if ( pAuto != 0 ) { UpdateAutoCheckButton( pAuto, camPropInfo.autoSupported, camProp.autoManualMode ); } if ( pOnOff != 0 ) { UpdateOnOffCheckButton( pOnOff, camPropInfo.onOffSupported, camProp.onOff ); } if ( pOnePush != 0 ) { UpdateOnePushCheckButton( pOnePush, camPropInfo.onePushSupported, camProp.onePush ); } if ( pAdjustment1 != 0 ) { UpdateAdjustment( pAdjustment1, &camPropInfo, &camProp ); pHScale1->show(); pHScale1->set_sensitive(true); UpdateSpinButton( pSpinButton1, &camPropInfo ); pSpinButton1->show(); } if ( pAdjustment2 != 0 ) { UpdateAdjustment( pAdjustment2, &camPropInfo, &camProp ); pHScale2->show(); pHScale2->set_sensitive(true); UpdateSpinButton( pSpinButton2, &camPropInfo ); pSpinButton2->show(); } if ( pLabel1 != 0 ) { UpdateLabel(pLabel1, &camPropInfo, &camProp ); } if ( pLabel2 != 0 ) { UpdateLabel(pLabel2, &camPropInfo, &camProp ); } } }