void
HTMLMenuItemElement::GetEventTargetParent(EventChainPreVisitor& aVisitor)
{
  if (aVisitor.mEvent->mMessage == eMouseClick) {

    bool originalCheckedValue = false;
    switch (mType) {
      case CMD_TYPE_CHECKBOX:
        originalCheckedValue = mChecked;
        SetChecked(!originalCheckedValue);
        aVisitor.mItemFlags |= NS_CHECKED_IS_TOGGLED;
        break;
      case CMD_TYPE_RADIO:
        // casting back to Element* here to resolve nsISupports ambiguity.
        Element* supports = GetSelectedRadio();
        aVisitor.mItemData = supports;

        originalCheckedValue = mChecked;
        if (!originalCheckedValue) {
          SetChecked(true);
          aVisitor.mItemFlags |= NS_CHECKED_IS_TOGGLED;
        }
        break;
    }

    if (originalCheckedValue) {
      aVisitor.mItemFlags |= NS_ORIGINAL_CHECKED_VALUE;
    }

    // We must cache type because mType may change during JS event.
    aVisitor.mItemFlags |= mType;
  }

  nsGenericHTMLElement::GetEventTargetParent(aVisitor);
}
nsresult
HTMLMenuItemElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
  if (aVisitor.mEvent->message == NS_MOUSE_CLICK) {

    bool originalCheckedValue = false;
    switch (mType) {
      case CMD_TYPE_CHECKBOX:
        originalCheckedValue = mChecked;
        SetChecked(!originalCheckedValue);
        aVisitor.mItemFlags |= NS_CHECKED_IS_TOGGLED;
        break;
      case CMD_TYPE_RADIO:
        nsCOMPtr<nsIDOMHTMLMenuItemElement> selectedRadio = GetSelectedRadio();
        aVisitor.mItemData = selectedRadio;

        originalCheckedValue = mChecked;
        if (!originalCheckedValue) {
          SetChecked(true);
          aVisitor.mItemFlags |= NS_CHECKED_IS_TOGGLED;
        }
        break;
    }

    if (originalCheckedValue) {
      aVisitor.mItemFlags |= NS_ORIGINAL_CHECKED_VALUE;
    }

    // We must cache type because mType may change during JS event.
    aVisitor.mItemFlags |= mType;
  }

  return nsGenericHTMLElement::PreHandleEvent(aVisitor);
}
void SharedDesktopArea::Init()
{
	//
	// configure select window picture
	//

	HWND bmp_hWnd = GetDlgItem(m_hwnd, IDC_BMPCURSOR);
	m_OldBmpWndProc = GetWindowLong(bmp_hWnd, GWL_WNDPROC);
	SetWindowLong(bmp_hWnd, GWL_WNDPROC, (LONG)BmpWndProc);
	SetWindowLong(bmp_hWnd, GWL_USERDATA, (LONG)this);

	//
	// setup match window
	//

	if (m_pMatchWindow == NULL)
		SetupMatchWindow();

	m_pMatchWindow->CanModify(TRUE);
	m_pMatchWindow->Hide();

	//
	// initialize controls
	//

	SetChecked(IDC_FULLSCREEN, m_server->FullScreen());
	SetChecked(IDC_PRIMARY_DISPLAY_ONLY, m_server->PrimaryDisplayOnlyShared());
	SetChecked(IDC_SCREEN, m_server->ScreenAreaShared());
	SetChecked(IDC_WINDOW, m_server->WindowShared());
	m_hwndShared = m_server->GetWindowShared();

	Validate();
}
nsresult
HTMLMenuItemElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
  // Check to see if the event was cancelled.
  if (aVisitor.mEvent->message == NS_MOUSE_CLICK &&
      aVisitor.mItemFlags & NS_CHECKED_IS_TOGGLED &&
      aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault) {
    bool originalCheckedValue =
      !!(aVisitor.mItemFlags & NS_ORIGINAL_CHECKED_VALUE);
    uint8_t oldType = NS_MENUITEM_TYPE(aVisitor.mItemFlags);

    nsCOMPtr<nsIDOMHTMLMenuItemElement> selectedRadio =
      do_QueryInterface(aVisitor.mItemData);
    if (selectedRadio) {
      selectedRadio->SetChecked(true);
      if (mType != CMD_TYPE_RADIO) {
        SetChecked(false);
      }
    } else if (oldType == CMD_TYPE_CHECKBOX) {
      SetChecked(originalCheckedValue);
    }
  }

  return NS_OK;
}
static void mbUpdateFunc(void* obj, EventArg* arg)
{
	uint8_t chMode, i;
	
	ChannelPanelMenu* cpm = (ChannelPanelMenu*)((FullPanel*)obj)->parent;
	
	chMode = (uint8_t) cpm->params->modeWorkChannel_6E;
	
	for(i = 0; i < 8; i++)
	{
		bool checked = true;
		
		if ((chMode & (1 << i)) == 0)
			checked = false;
		
		SetChecked(cpm->chlsRb[i], checked);
		SetChecked(cpm->chlsRb[i+8], !checked);
	}
	
	for(i = 0; i < 12; i++)
	{
		SetCheckedCheckBox(cpm->chBoxFlagsError[i], cpm->params->FlagErrors_33[i]);
	}
	
	sprintf(cpm->textBoxPeriodCicle->Text, "%5d", cpm->params->periodCicle_6D);
	sprintf(cpm->textBoxPeriodCalib->Text, "%5d", cpm->params->periodCalib_6A);
	sprintf(cpm->textBoxMaxError->Text, "%3.2f", cpm->params->maxError_6B);
	
}
Exemple #6
0
void ezParticleAction::UpdateState()
{
  if (m_Type == ActionType::PauseEffect)
  {
    SetCheckable(true);
    SetChecked(m_pEffectDocument->GetSimulationPaused());
  }

  if (m_Type == ActionType::AutoRestart)
  {
    SetCheckable(true);
    SetChecked(m_pEffectDocument->GetAutoRestart());
  }

  if (m_Type == ActionType::SimulationSpeed)
  {
    SetCheckable(true);
    SetChecked(m_pEffectDocument->GetSimulationSpeed() == m_fSimSpeed);
  }

    if (m_Type == ActionType::RenderVisualizers)
  {
    SetCheckable(true);
    SetChecked(m_pEffectDocument->GetRenderVisualizers());
  }
}
void ARadioButton::ESSet(const AString& sPath,AUI_ES_VALUE_INTF* pValue)
{
	if( pValue == NULL ) return;
	base_class::ESSet(sPath,pValue);
	if( sPath == _T("Checked") ) SetChecked( pValue->GetString()==_T("1") ? true : false );
	else if( sPath == _T("Group") ) SetGroup( pValue->GetInt() );
}
Exemple #8
0
ezParticleAction::ezParticleAction(const ezActionContext& context, const char* szName, ezParticleAction::ActionType type, float fSimSpeed)
    : ezButtonAction(context, szName, false, "")
{
  m_Type = type;
  m_fSimSpeed = fSimSpeed;

  m_pEffectDocument = const_cast<ezParticleEffectAssetDocument*>(static_cast<const ezParticleEffectAssetDocument*>(context.m_pDocument));
  m_pEffectDocument->m_Events.AddEventHandler(ezMakeDelegate(&ezParticleAction::EffectEventHandler, this));

  switch (m_Type)
  {
    case ActionType::PauseEffect:
      SetIconPath(":/EditorPluginParticle/Icons/Pause16.png");
      break;

    case ActionType::RestartEffect:
      SetIconPath(":/EditorPluginParticle/Icons/Restart16.png");
      break;

    case ActionType::AutoRestart:
      SetIconPath(":/EditorPluginParticle/Icons/Loop16.png");
      break;

    case ActionType::RenderVisualizers:
      SetCheckable(true);
      SetIconPath(":/EditorFramework/Icons/Visualizers16.png");
      SetChecked(m_pEffectDocument->GetRenderVisualizers());
      break;
  }

  UpdateState();
}
void CheckBoxObject::Init(const CheckBoxObject &other)
{
    position = other.position;
    fontName = other.fontName;
    obj = sfg::CheckButton::Create(other.obj->GetLabel());
    backgroundColor = new ColorScheme(*(other.backgroundColor));
    borderColor = new ColorScheme(*(other.borderColor));
    textColor = new ColorScheme(*(other.textColor));
    checkColor = new ColorScheme(*(other.checkColor));
    SetChecked(other.IsChecked());
    width = other.width;
    height = other.height;
    fontSize = other.fontSize;
    borderWidth = other.borderWidth;
    padding = other.padding;
    boxSize = other.boxSize;
    checkSignSize = other.checkSignSize;

    obj->SetId(ToString<void*>(this));

    ConnectSignals();
    ResetEventInformations();

    UpdateSize();
    UpdateProperties();
}
	bool cWidgetCheckBox::OnMouseUp(cGuiMessageData &aData)
	{
		if(mbPressed) SetChecked(!mbChecked);
		
		mbPressed = false;
		return true;
	}
Exemple #11
0
void FolderTree::UpdateChildItems(HTREEITEM hItem, bool bChecked)
{
	HTREEITEM hChild = GetChildItem(hItem);
	while(hChild)
	{
		SetChecked(hChild, bChecked);
		UpdateChildItems(hChild, bChecked);
		hChild = GetNextSiblingItem(hChild);
	}
}
Exemple #12
0
CMessageRecordItemIconCheckText::CMessageRecordItemIconCheckText(CString szText,unsigned int nIconID, BOOL bHasCheckBox, BOOL bCheck)
: m_bRead(bCheck)
{
	SetValue(szText);

	HasCheckbox(bHasCheckBox);
	SetChecked(bCheck);

	SetIconIndex(nIconID);
}
Exemple #13
0
int RadioButton::HandleMessage( gui_message *kMsg )
{
	if ( !kMsg )
	{
		Logger::WriteLine( "NULL msg in RadioButton::HandleMessage(gui_message *)", __FILE__, __LINE__, LEVEL_ERROR );
		return false;
	}

	switch ( kMsg->type )
	{
	case MESSAGE_MOUSEDOWN:
		if ( MouseIsOver( kMsg->mouseevent.x, kMsg->mouseevent.y ) )
		{
			printf( "%d %d %d\n", x, y, IsChecked() );
			if ( !IsChecked() )
			{
				// Now uncheck all other radios in group:
				ControlList_t *list = NULL;
				ControlList_t::iterator iter;

				if ( parent == NULL )
				{
					list = pUOGUI.GetControlList();
				}
				else
				{
					list = parent->GetControlList();
				}

				for ( iter = list->begin(); iter != list->end(); iter++ )
				{
					if ( dynamic_cast<RadioButton *>( iter->second ) )
					{
						RadioButton *kRadio = (RadioButton *)iter->second;
						if ( kRadio->GetGroup() == GetGroup() )
						{
							kRadio->SetChecked( false );
						}
					}
				}

				// I know I am repeating this instruction but it's the fastest way!
				SetChecked( true );

				return true;
			}
		}
		break;

	default:
		return Checkbox::HandleMessage( kMsg );
	}

	return false;
}
Exemple #14
0
void CPPageFormats::OnBnClickedButton14()
{
	CMediaFormats& mf = AfxGetAppSettings().m_Formats;

	for (int i = 0, j = m_list.GetItemCount(); i < j; i++) {
		if (!mf[m_list.GetItemData(i)].GetLabel().CompareNoCase(_T("pls"))) {
			SetChecked(i, 0);
			continue;
		}
		SetChecked(i, mf[(int)m_list.GetItemData(i)].IsAudioOnly()?0:1);
	}
	m_bFileExtChanged = true;

	m_apvideo.SetCheck(1);
	m_apmusic.SetCheck(0);
	m_apaudiocd.SetCheck(0);
	m_apdvd.SetCheck(1);

	SetModified();
}
Exemple #15
0
void FolderTree::checkRemovedDirs(const tstring& aParentPath, HTREEITEM hParent) {
	string parentPath = Text::fromT(aParentPath);
	for(auto& sd: sp->getCurItems()) {
		if (sd->found || !sd->isCurItem())
			continue;

		auto dir = Util::getParentDir(sd->dir->path);
		if (dir == parentPath) {
			//this should have been inserted
			FolderTreeItemInfo* pItem = new FolderTreeItemInfo;
			pItem->m_sFQPath = Text::toT(sd->dir->path);
			pItem->m_sRelativePath = Text::toT(Util::getLastDir(sd->dir->path));
			pItem->m_removed = true;

			tstring sLabel;

			//Correct the label if need be
			if(IsDrive(pItem->m_sFQPath) && m_bShowDriveLabels)
				sLabel = GetDriveLabel(pItem->m_sFQPath);
			else
				sLabel = GetCorrectedLabel(pItem);

			sLabel = _T("REMOVED: ") + sLabel;

			//Add the actual item
			TV_INSERTSTRUCT tvis;
			memzero(&tvis, sizeof(TV_INSERTSTRUCT));
			tvis.hParent = hParent;
			tvis.hInsertAfter = TVI_FIRST;
			tvis.item.mask = TVIF_CHILDREN | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT | TVIF_PARAM;
			//tvis.item.iImage = 7;
			//tvis.item.iSelectedImage = 7;
			tvis.item.iImage = 1;
			tvis.item.iSelectedImage = 1;

			tvis.item.lParam = (LPARAM) pItem;
			tvis.item.pszText = (LPWSTR)sLabel.c_str();
			tvis.item.cChildren = false;
	
			tvis.item.mask |= TVIF_STATE;
			tvis.item.stateMask |= TVIS_OVERLAYMASK;
			tvis.item.state = TVIS_BOLD | INDEXTOOVERLAYMASK(1); //1 is the index for the shared overlay image
			tvis.item.state |= TVIS_BOLD;

			//tvis.item.state = TVIS_BOLD;
			//tvis.item.stateMask = TVIS_BOLD;

			HTREEITEM hItem = InsertItem(&tvis);
			//SetItemImage(hItem, MAKEINTRESOURCE(IDI_ERROR), MAKEINTRESOURCE(IDI_ERROR));
			SetChecked(hItem, true);
			SetItemState(hItem, TVIS_BOLD, TVIS_BOLD);
		}
	}
}
void IncomingConnectionsControls::InitPortSettings(BOOL CheckedButton)
{
	BOOL bAutoPort = m_server->AutoPortSelect();
	UINT port_rfb = m_server->GetPort();
	UINT port_http = m_server->GetHttpPort();
	int d1 = PORT_TO_DISPLAY(port_rfb);
	int d2 = HPORT_TO_DISPLAY(port_http);
	BOOL bValidDisplay = (d1 == d2 && d1 >= 0 && d1 <= 99);
	if (bValidDisplay) {
		SetDlgItemInt(m_hwnd, IDC_DISPLAYNO, d1, FALSE);
	} else {
		SetDlgItemText(m_hwnd, IDC_DISPLAYNO, "");
	}
	SetDlgItemInt(m_hwnd, IDC_PORTRFB, port_rfb, FALSE);
	SetDlgItemInt(m_hwnd, IDC_PORTHTTP, port_http, FALSE);
	if (CheckedButton) {
		SetChecked(IDC_PORTNO_AUTO, bAutoPort);
		SetChecked(IDC_SPECDISPLAY, (!bAutoPort && bValidDisplay));
		SetChecked(IDC_SPECPORT, (!bAutoPort && !bValidDisplay));
	}
}
Exemple #17
0
void CPPageFormats::OnBnClickedButton14()
{
	CMediaFormats& mf = AfxGetAppSettings().Formats;

	for(int i = 0, j = m_list.GetItemCount(); i < j; i++)
	{
		if(!mf[m_list.GetItemData(i)].GetLabel().CompareNoCase(ResStr(IDS_AG_PLAYLIST_FILE)))
		{
			SetChecked(i, 0);
			continue;
		}
		SetChecked(i, mf[(int)m_list.GetItemData(i)].IsAudioOnly()?0:1);
	}

	m_apvideo.SetCheck(1);
	m_apmusic.SetCheck(0);
	m_apaudiocd.SetCheck(0);
	m_apdvd.SetCheck(1);

	SetModified();
}
UICheckBox::UICheckBox(const String &spriteName, const Rect &rect, bool rectInAbsoluteCoordinates)
    :   UIControl(rect, rectInAbsoluteCoordinates)
{
    checkboxDelegate = NULL;
    
    GetBackground()->SetAlign(ALIGN_HCENTER | ALIGN_VCENTER);
    GetBackground()->SetDrawType(UIControlBackground::DRAW_SCALE_TO_RECT);
    
    SetSprite(spriteName, 0);
    SetChecked(false, false);

    AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &UICheckBox::OnClick));
}
void IncomingConnectionsControls::Init()
{
	BOOL bConnectSock = m_server->SockConnected();

	SetChecked(IDC_CONNECT_SOCK, bConnectSock);
	SetChecked(IDC_ENABLE_FILE_TRANSFERS, m_server->FileTransfersEnabled());
	SetChecked(IDC_REMOVE_WALLPAPER, m_server->RemoveWallpaperEnabled());
	SetChecked(IDC_BLANK_SCREEN, m_server->GetBlankScreen());
	SetChecked(IDC_ENABLE_METAWM, m_server->MetaWindowManagerEnabled());

	SetDlgItemText(m_hwnd, IDC_PASSWORD, "~~~~~~~~");			
	SetDlgItemText(m_hwnd, IDC_PASSWORD_VIEWONLY, "~~~~~~~~");

	if (bConnectSock) {
		SetFocus(GetDlgItem(m_hwnd, IDC_PASSWORD));
		SendDlgItemMessage(m_hwnd, IDC_PASSWORD, EM_SETSEL, 0, (LPARAM)-1);
	} else {
		SetFocus(GetDlgItem(m_hwnd, IDC_CONNECT_SOCK));
	}

	Validate(TRUE);
}
Exemple #20
0
/*--------------------------------------------------------------------------*/
void PegMenuButton::SendOwnerMessage(void)
{
    if (mpSubMenu || !mpOwner || Parent()->Type() == TYPE_MENU_BAR)
    {
        return;
    }
    Presentation()->MoveFocusTree(mpOwner);
            
    if (mwStyle & BF_CHECKABLE)
    {
        if (mwStyle & BF_CHECKED)
        {
            SetChecked(FALSE);
        }
        else
        {
            SetChecked(TRUE);
        }
    }
    else
    {
        if (mwStyle & BF_DOTABLE)
        {
            RemoveSiblingDots();
            SetDotted(TRUE);
        }
        else
        {
            if (Id())
            {
                PegMessage NewMessage(mpOwner, PEG_SIGNAL(Id(), PSF_CLICKED));
                NewMessage.iData = Id();
                NewMessage.pSource = this;
                MessageQueue()->Push(NewMessage);
            }
        }
    }
}
Exemple #21
0
HTREEITEM FolderTree::InsertFileItem(HTREEITEM hParent, FolderTreeItemInfo *pItem, bool bShared, int nIcon, int nSelIcon, bool bCheckForChildren)
{
	tstring sLabel;

	//Correct the label if need be
	if(IsDrive(pItem->m_sFQPath) && m_bShowDriveLabels)
		sLabel = GetDriveLabel(pItem->m_sFQPath);
	else
		sLabel = GetCorrectedLabel(pItem);

	//Add the actual item
	TV_INSERTSTRUCT tvis;
	memzero(&tvis, sizeof(TV_INSERTSTRUCT));
	tvis.hParent = hParent;
	tvis.hInsertAfter = TVI_LAST;
	tvis.item.mask = TVIF_CHILDREN | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT | TVIF_PARAM;
	tvis.item.iImage = nIcon;
	tvis.item.iSelectedImage = nSelIcon;

	tvis.item.lParam = (LPARAM) pItem;
	tvis.item.pszText = (LPWSTR)sLabel.c_str();
	if (bCheckForChildren)
		tvis.item.cChildren = HasGotSubEntries(pItem->m_sFQPath);
	else
		tvis.item.cChildren = true;

	if(bShared)
	{
		tvis.item.mask |= TVIF_STATE;
		tvis.item.stateMask |= TVIS_OVERLAYMASK;
		tvis.item.state |= INDEXTOOVERLAYMASK(1); //1 is the index for the shared overlay image
	}

	HTREEITEM hItem = InsertItem(&tvis);
	
	bool bChecked = false;
	if (!pItem->m_sFQPath.empty()) {
		string path = Text::fromT(pItem->m_sFQPath);
		if( path[ path.length() -1 ] != PATH_SEPARATOR )
			path += PATH_SEPARATOR;

		bChecked = sp->shareFolder(path);
		SetChecked(hItem, bChecked);
	}

	if(!bChecked)
		SetHasSharedChildren(hItem);

	return hItem;
}
Exemple #22
0
void CPPageFormats::OnBnClickedButton1()
{
	for(int i = 0, j = m_list.GetItemCount(); i < j; i++)
	{
		SetChecked(i, 1);
	}

	m_apvideo.SetCheck(1);
	m_apmusic.SetCheck(1);
	m_apaudiocd.SetCheck(1);
	m_apdvd.SetCheck(1);

	SetModified();
}
	void CMenuElementUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
	{
		if( _tcsicmp(pstrName, _T("icon")) == 0){
			SetIcon(pstrValue);
		}
		else if( _tcsicmp(pstrName, _T("iconsize")) == 0 ) {
			LPTSTR pstr = NULL;
			LONG cx = 0, cy = 0;
			cx = _tcstol(pstrValue, &pstr, 10);  ASSERT(pstr);    
			cy = _tcstol(pstr + 1, &pstr, 10);    ASSERT(pstr);   
			SetIconSize(cx, cy);
		}
		else if( _tcsicmp(pstrName, _T("checkitem")) == 0 ) {		
			SetCheckItem(_tcsicmp(pstrValue, _T("true")) == 0 ? true : false);		
		}
		else if( _tcsicmp(pstrName, _T("ischeck")) == 0 ) {		
			if (CMenuWnd::GetGlobalContextMenuObserver().GetMenuCheckInfo() != NULL && CMenuWnd::GetGlobalContextMenuObserver().GetMenuCheckInfo()->find(GetName()) == CMenuWnd::GetGlobalContextMenuObserver().GetMenuCheckInfo()->end())
			{
				SetChecked(_tcsicmp(pstrValue, _T("true")) == 0 ? true : false);
			}	
		}	
		else if( _tcsicmp(pstrName, _T("linetype")) == 0){
			if (_tcsicmp(pstrValue, _T("true")) == 0)
				SetLineType();
		}
		else if( _tcsicmp(pstrName, _T("expland")) == 0 ) {
			SetShowExplandIcon(_tcsicmp(pstrValue, _T("true")) == 0 ? true : false);
		}
		else if( _tcsicmp(pstrName, _T("linecolor")) == 0){
			if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
			LPTSTR pstr = NULL;
			SetLineColor(_tcstoul(pstrValue, &pstr, 16));
		}
		else if( _tcsicmp(pstrName, _T("linepadding")) == 0 ) {
			RECT rcInset = { 0 };
			LPTSTR pstr = NULL;
			rcInset.left = _tcstol(pstrValue, &pstr, 10);  ASSERT(pstr);    
			rcInset.top = _tcstol(pstr + 1, &pstr, 10);    ASSERT(pstr);    
			rcInset.right = _tcstol(pstr + 1, &pstr, 10);  ASSERT(pstr);    
			rcInset.bottom = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr);    
			SetLinePadding(rcInset);
		}
		else if	( _tcsicmp(pstrName, _T("height")) == 0){
			SetFixedHeight(_ttoi(pstrValue));
		}
		else
			CListContainerElementUI::SetAttribute(pstrName, pstrValue);
	}
Exemple #24
0
void CPPageFormats::OnBnClickedButton13()
{
	CMediaFormats& mf = AfxGetAppSettings().Formats;

	for(int i = 0, j = m_list.GetItemCount(); i < j; i++)
	{
		SetChecked(i, mf[(int)m_list.GetItemData(i)].IsAudioOnly()?1:0);
	}

	m_apvideo.SetCheck(0);
	m_apmusic.SetCheck(1);
	m_apaudiocd.SetCheck(1);
	m_apdvd.SetCheck(0);

	SetModified();
}
Exemple #25
0
void CSubtitleDlDlg::OnNMClickList1(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)pNMHDR;

	if(lpnmlv->iItem >= 0)
	{
		CRect r;
		m_list.GetItemRect(lpnmlv->iItem, r, LVIR_ICON);
		if(r.PtInRect(lpnmlv->ptAction))
		{
			SetChecked(lpnmlv->iItem, (GetChecked(lpnmlv->iItem)&1) == 0 ? 1 : 0);
		}
	}

	*pResult = 0;
}
Exemple #26
0
void    pfGUICheckBoxCtrl::HandleMouseUp( hsPoint3 &mousePt, uint8_t modifiers )
{
    if( fClicking )
    {
        fClicking = false;

        if(fPlaySound)
            IPlaySound( kMouseUp );

        // Don't run the command if the mouse is outside our bounds
        if( fBounds.IsInside( &mousePt ) )
        {
            SetChecked( !fChecked );
            DoSomething();
        }
    }
}
Exemple #27
0
void CPPageFormats::SetListItemState(int nItem)
{
	if(nItem < 0) return;

	CString str = AfxGetAppSettings().Formats[(int)m_list.GetItemData(nItem)].GetExtsWithPeriod();

	CAtlList<CString> exts;
	ExplodeMin(str, exts, ' ');

	int cnt = 0;

	POSITION pos = exts.GetHeadPosition();
	while(pos) if(IsRegistered(exts.GetNext(pos))) cnt++;

	if (cnt != 0)
		cnt = (cnt == (int)exts.GetCount() ? 1 : 2);
	SetChecked(nItem, cnt);
}
Exemple #28
0
void ecSolutionListCtrl::OnMouseEvent(wxMouseEvent& event)
{
    if (event.LeftDown())
    {
        int flags;
        long item = HitTest(event.GetPosition(), flags);
        if (item > -1 && (flags & wxLIST_HITTEST_ONITEMICON))
        {
            SetChecked(item, !IsChecked(item));
        }
        else
            event.Skip();
    }
    else
    {
        event.Skip();
    }
}
Exemple #29
0
void FolderTree::ShareParentButNotSiblings(HTREEITEM hItem)
{
	FolderTreeItemInfo* pItem;
	HTREEITEM hParent = GetParentItem(hItem);
	if(!GetChecked(hParent))
	{
		SetChecked(hParent, true);
		pItem = (FolderTreeItemInfo*) GetItemData(hParent);
		string path = Text::fromT(pItem->m_sFQPath);
		if( path[ path.length() -1 ] != PATH_SEPARATOR )
			path += PATH_SEPARATOR;
		//m_nShareSizeDiff += ShareManager::getInstance()->removeExcludeFolder(path);
		sp->removeExcludeFolder(path);

		ShareParentButNotSiblings(hParent);
		
		HTREEITEM hChild = GetChildItem(hParent);
		while(hChild)
		{
			HTREEITEM hNextItem = GetNextSiblingItem(hChild);
			if(!GetChecked(hChild))
			{
				pItem = (FolderTreeItemInfo*) GetItemData(hChild);
				if(hChild != hItem) {
					path = Text::fromT(pItem->m_sFQPath);
					if( path[ path.length() -1 ] != PATH_SEPARATOR )
						path += PATH_SEPARATOR;
					//m_nShareSizeDiff -= ShareManager::getInstance()->addExcludeFolder(path);
					sp->addExcludeFolder(path);
				}
			}
			hChild = hNextItem;
		}
	}
	else
	{
		pItem = (FolderTreeItemInfo*) GetItemData(hItem);
		string path = Text::fromT(pItem->m_sFQPath);
		if( path[ path.length() -1 ] != PATH_SEPARATOR )
			path += PATH_SEPARATOR;
		sp->removeExcludeFolder(path);
	}
}
Exemple #30
0
void CPPageFormats::OnNMClickList1(NMHDR* pNMHDR, LRESULT* pResult)
{
	LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)pNMHDR;

	if (lpnmlv->iItem >= 0 && lpnmlv->iSubItem == COL_CATEGORY) {
		CRect r;
		m_list.GetItemRect(lpnmlv->iItem, r, LVIR_ICON);
		if (r.PtInRect(lpnmlv->ptAction)) {
			if (m_bInsufficientPrivileges) {
				MessageBox (ResStr (IDS_CANNOT_CHANGE_FORMAT));
			} else {
				SetChecked(lpnmlv->iItem, (GetChecked(lpnmlv->iItem)&1) == 0 ? 1 : 0);
				m_bFileExtChanged = true;
				SetModified();
			}
		}
	}

	*pResult = 0;
}