コード例 #1
0
ファイル: browser_cover.cpp プロジェクト: boh1996/silverjuke
void SjCoverBrowser::OnMouseMiddleUp(wxMouseEvent& event)
{
	bool    skip = TRUE;
	SjCol* cover;
	long found = FindCover(event.GetX(), event.GetY(), &cover);
	if( found == FOUND_COVER && cover->m_rowCount > 0 )
	{
		SjRow* row = cover->m_rows[0];
		int usesMiddleClick = row->UsesMiddleClick();
		if( usesMiddleClick )
		{
			g_mainFrame->m_columnMixer.SelectAll(false);
			SelectAllRows(cover);
			RefreshSelection();
			m_window->Update();
			skip = FALSE;

			row->OnMiddleClick(event.ShiftDown() || event.ControlDown());
		}
	}

	if( skip )
	{
		event.Skip();
	}
}
コード例 #2
0
ファイル: browser_cover.cpp プロジェクト: boh1996/silverjuke
void SjCoverBrowser::OnContextMenu(int clickX, int clickY)
{
	SjMenu  mainMenu(0);
	SjCol* cover;
	long found = FindCover(clickX, clickY, &cover);
	if( found == FOUND_COVER && cover->m_rowCount > 0 && cover->m_rows[0]->m_roughType == SJ_RRTYPE_COVER )
	{
		// select the item under the mouse
		if( cover->FindFirstSelectedRow() == NULL )
		{
			g_mainFrame->m_columnMixer.SelectAll(FALSE);
			SelectAllRows(cover);
			RefreshSelection();
		}

		m_lastClickedCover = cover;
		cover->m_rows[0]->CreateContextMenu(mainMenu);
	}
	else
	{
		m_lastClickedCover = NULL;
	}

	// add main items to menu
	g_mainFrame->CreateContextMenu_(mainMenu);

	// show menu
	if( mainMenu.GetMenuItemCount() )
	{
		m_window->PopupMenu(&mainMenu);
	}
}
コード例 #3
0
void DisplayDirector::ExtendSelection()
{
	if (selection == NULL)
		return;

	View* view = WindowView();
	BPoint lastPoint;
	Selection* rootSelection = selection;
	bool scrolling = false;
	while (true) {
		// get the mouse point and check if moved/finished
		int buttons = view->GetMouseButtons();
		if (buttons == 0)
			break;
		BPoint point = view->GetMousePoint();
		Autoscroll(point);
		point = ViewToDoc(point);
		if (point == lastPoint && !scrolling) {
			view->MouseTrackingPause();
			continue;
			}

		// change the selection
		Selection* newSelection = rootSelection->ExtendTo(point);
		if (newSelection != selection) {
			StartRefreshCycle();
			RefreshSelection();

			if (selection != rootSelection)
				delete selection;
			selection = newSelection;

			scrolling = DoScrollStep();

			RefreshSelection();
			FinishRefreshCycle();
			}

		lastPoint = point;
		}

	// clean up root selection
	if (selection != rootSelection)
		delete rootSelection;
}
コード例 #4
0
ファイル: filter-dlg.cpp プロジェクト: JGRennison/retcon
void filter_dlg::ReCalculateCategories() {
	const tweetidset *current = getidset();
	for (auto &it : checkboxmap) {
		selection_category &sc = it.second;
		sc.func(*current, it.second);
		sc.stattext->SetLabel(wxString::Format(wxT("%d"), sc.GetOutputSet().size()));
	}
	RefreshSelection();
}
コード例 #5
0
ファイル: browser_cover.cpp プロジェクト: boh1996/silverjuke
void SjCoverBrowser::OnMouseSelect(wxMouseEvent& event)
{
	/* (de-)select the item under the mouse (if any)
	 */
	SjCol* cover;
	long found = FindCover(event.GetX(), event.GetY(), &cover);
	if( found == FOUND_COVER )
	{
		g_mainFrame->m_columnMixer.SelectAll(false);
		SelectAllRows(cover);
		RefreshSelection();
	}
	else if( found == FOUND_COVER_ARROW )
	{
		g_mainFrame->GetEventHandler()->QueueEvent(new wxCommandEvent(wxEVT_COMMAND_MENU_SELECTED, IDT_WORKSPACE_SHOW_COVERS));
	}
	else if( g_mainFrame->m_columnMixer.IsAnythingSelected() )
	{
		g_mainFrame->m_columnMixer.SelectAll(false);
		RefreshSelection();
	}
}
コード例 #6
0
void CDDBaseGrid::OnCharDown(UINT* vcKey, BOOL processed)
{ 
   // Save the current selection, starting edit will clear a multi-select but we want it.
   CaptureSelection();

   // Pressing a char key starts edit in cell.
   // Passing in a char will wipe out current cell contents, ie char replaces contents,
   // because edit starts with whole cell content selected.
   // If char is Enter then start edit but send no chars, i.e. do not update cell, just start editing.

   if (*vcKey == 13)
   {
      StartEdit( );
   }
   else if (*vcKey == 22) // ctrl-v, aka Paste
   {
      int col = this->GetCurrentCol();
      int row = this->GetCurrentRow();
      CWnd *peditctrl;
      if (this->OnEditStart(col, row, &peditctrl))   // dis-allows pasting into non-edit cells
      {
         this->Paste();
         this->BestFit(0, GetNumberCols()-1, myUG_FIT_ALL_ROWS, UG_BESTFIT_TOPHEADINGS);
         CString value;
         this->QuickGetText(col, row, &value);
         this->OnEditFinish(col, row, peditctrl, value, FALSE);
      }

      //StartEdit();
   }
   else
   {
      StartEdit(*vcKey);
   }

   RefreshSelection();
}
コード例 #7
0
ファイル: filter-dlg.cpp プロジェクト: JGRennison/retcon
void filter_dlg::CheckBoxUpdate(wxCommandEvent &event) {
	RefreshSelection();
}