コード例 #1
0
ファイル: SpyFrame.cpp プロジェクト: craxycat/flylinkdc-r5xx
LRESULT SpyFrame::onTimer(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
	m_needsUpdateTime = true;//[+]IRainman refactoring SpyFrame
	if (!MainFrame::isAppMinimized(m_hWnd) && !isClosedOrShutdown())// [+] IRainman opt
	{
		auto s = new Stats;
		for (size_t i = 0; i < AVG_TIME; ++i)
			s->m_perM += m_perSecond[i];
			
		s->m_perS = s->m_perM / AVG_TIME;
		m_tasks.add(TICK_AVG, s);
	}
	{
		if (m_current++ >= AVG_TIME)
			m_current = 0;
			
		m_perSecond[m_current] = 0;
	}
	if (m_log)
	{
		m_tasks.add(SAVE_LOG, nullptr);
	}
	doTimerTask();
	return 0;
}
コード例 #2
0
void WaitingUsersFrame::on(UploadManagerListener::QueueUpdate) noexcept
{
	if (!MainFrame::isAppMinimized(m_hWnd) && !isClosedOrShutdown()) // [+] IRainman opt.
	{
		m_tasks.add(UPDATE_ITEMS, nullptr);
	}
}
コード例 #3
0
void UsersFrame::UpdateLayout(BOOL bResizeBars /* = TRUE */)
{
	if (isClosedOrShutdown())
		return;
	RECT rect;
	GetClientRect(&rect);
	// position bars and offset their dimensions
	UpdateBarsPosition(rect, bResizeBars);
	
	CRect rc = rect;
	ctrlUsers.MoveWindow(rc);
}
コード例 #4
0
ファイル: TextFrame.cpp プロジェクト: craxycat/flylinkdc-r5xx
void TextFrame::UpdateLayout(BOOL /*bResizeBars*/ /* = TRUE */)
{
	if (isClosedOrShutdown())
		return;
	CRect rc;
	
	GetClientRect(rc);
	
	rc.bottom -= 1;
	rc.top += 1;
	rc.left += 1;
	rc.right -= 1;
	ctrlPad.MoveWindow(rc);
}
コード例 #5
0
void WaitingUsersFrame::UpdateLayout(BOOL bResizeBars /* = TRUE */)
{
	if (isClosedOrShutdown())
		return;
	RECT rect;
	GetClientRect(&rect);
	// position bars and offset their dimensions
	UpdateBarsPosition(rect, bResizeBars);
	
	if (ctrlStatus.IsWindow())
	{
		CRect sr;
		int w[4];
		ctrlStatus.GetClientRect(sr);
		w[3] = sr.right - 16;
#define setw(x) w[x] = max(w[x+1] - statusSizes[x], 0)
		setw(2);
		setw(1);
#undef setw
		w[0] = 36;
		
		ctrlStatus.SetParts(4, w);
		
		ctrlStatus.GetRect(0, sr);
		ctrlShowTree.MoveWindow(sr);
	}
	if (m_showTree)
	{
		if (GetSinglePaneMode() != SPLIT_PANE_NONE)
		{
			SetSinglePaneMode(SPLIT_PANE_NONE);
		}
	}
	else
	{
		if (GetSinglePaneMode() != SPLIT_PANE_RIGHT)
		{
			SetSinglePaneMode(SPLIT_PANE_RIGHT);
		}
	}
	CRect rc = rect;
	SetSplitterRect(rc);
}
コード例 #6
0
void FavoriteHubsFrame::UpdateLayout(BOOL bResizeBars /* = TRUE */)
{
	if (isClosedOrShutdown())
		return;
	RECT rect;
	GetClientRect(&rect);
	// position bars and offset their dimensions
	UpdateBarsPosition(rect, bResizeBars);
	
	CRect rc = rect;
	rc.bottom -= 28;
	ctrlHubs.MoveWindow(rc);
	
	const long bwidth = 90;
	const long bspace = 10;
	
	rc = rect;
	rc.bottom -= 2;
	rc.top = rc.bottom - 22;
	
	rc.left = 2;
	rc.right = rc.left + bwidth;
	ctrlNew.MoveWindow(rc);
	
	rc.OffsetRect(bwidth + 2, 0);
	ctrlProps.MoveWindow(rc);
	
	rc.OffsetRect(bwidth + 2, 0);
	ctrlRemove.MoveWindow(rc);
	
	rc.OffsetRect(bspace + bwidth + 2, 0);
	ctrlUp.MoveWindow(rc);
	
	rc.OffsetRect(bwidth + 2, 0);
	ctrlDown.MoveWindow(rc);
	
	rc.OffsetRect(bspace + bwidth + 2, 0);
	ctrlConnect.MoveWindow(rc);
	
	rc.OffsetRect(bspace + bwidth + 2, 0);
	rc.right += 16;
	ctrlManageGroups.MoveWindow(rc);
}
コード例 #7
0
void RSSNewsFrame::UpdateLayout(BOOL bResizeBars /*= TRUE*/)
{
	if (isClosedOrShutdown())
		return;
	RECT rect;
	GetClientRect(&rect);
	
	// position bars and offset their dimensions
	UpdateBarsPosition(rect, bResizeBars);
	/*
	if (ctrlStatus.IsWindow())  //[-] SCALOlaz
	{
	    CRect sr;
	    int w[4];
	    ctrlStatus.GetClientRect(sr);
	    w[3] = sr.right - 16;
	    w[2] = max(w[3] - 100, 0);
	    w[1] = max(w[2] - 100, 0);
	    w[0] = max(w[1] - 100, 0);
	
	    ctrlStatus.SetParts(4, w);
	}
	*/
	CRect rc = rect;
	rc.bottom -= 26;
	ctrlList.MoveWindow(rc);
	
	const long bwidth = 100;
	//const long bspace = 10;
	
	rc = rect;
	rc.bottom -= 2;
	rc.top = rc.bottom - 22;
	
	rc.left = 2;
	rc.right = rc.left + bwidth;
	ctrlRemoveAll.MoveWindow(rc);
	ctrlRemoveAll.ShowWindow(FALSE);    //SCALOlaz: Remove the string when the function onRemoveAll() is completed yet
	
	//rc.OffsetRect(bwidth + bspace, 0);
	//ctrlSomeButton.MoveWindow(rc);
}
コード例 #8
0
ファイル: SpyFrame.cpp プロジェクト: craxycat/flylinkdc-r5xx
void SpyFrame::UpdateLayout(BOOL bResizeBars /* = TRUE */)
{
	if (isClosedOrShutdown())
		return;
	RECT rect;
	GetClientRect(&rect);
	// position bars and offset their dimensions
	UpdateBarsPosition(rect, bResizeBars);
	
	if (ctrlStatus.IsWindow())
	{
		CRect sr;
		int w[6];
		ctrlStatus.GetClientRect(sr);
		
		const int tmp = sr.Width() > 616 ? 516 : (sr.Width() > 116 ? sr.Width() - 100 : 16);
		
		w[0] = 170;
		w[1] = sr.right - tmp - 150;
		w[2] = w[1] + (tmp - 16) * 1 / 4;
		w[3] = w[1] + (tmp - 16) * 2 / 4;
		w[4] = w[1] + (tmp - 16) * 3 / 4;
		w[5] = w[1] + (tmp - 16) * 4 / 4;
		
		ctrlStatus.SetParts(6, w);
		
		ctrlStatus.GetRect(0, sr);
		m_ctrlIgnoreTTH.MoveWindow(sr);
		sr.MoveToX(170);
		sr.right += 50;
		m_ctrlShowNick.MoveWindow(sr);
		sr.MoveToX(sr.right + 10);
		sr.right += 200;
		m_ctrlSpyLogFile.MoveWindow(sr);
	}
	
	ctrlSearches.MoveWindow(&rect);
}
コード例 #9
0
void PublicHubsFrame::UpdateLayout(BOOL bResizeBars /* = TRUE */)
{
	if (isClosedOrShutdown())
		return;
	RECT rect;
	GetClientRect(&rect);
	// position bars and offset their dimensions
	UpdateBarsPosition(rect, bResizeBars);
	
	if (ctrlStatus.IsWindow())
	{
		CRect sr;
		int w[3];
		ctrlStatus.GetClientRect(sr);
		int tmp = (sr.Width() > 600) ? 180 : 150;
		
		w[2] = sr.right;
		w[1] = w[2] - tmp;          // Users Field start
		w[0] = w[1] - (tmp / 2);    // Hubs Field start
		
		ctrlStatus.SetParts(3, w);
	}
	
	int const comboH = 140;
	
	// listview
	CRect rc = rect;
	//rc.top += 2; //[~] Sergey Shuhskanov
	rc.bottom -= 56;
	m_ctrlHubs.MoveWindow(rc);
	
	// filter box
	rc = rect;
	rc.left += 4;
	rc.top = rc.bottom - 52;
	rc.bottom = rc.top + 46;
	rc.right -= 100;
	rc.right -= ((rc.right - rc.left) / 2) + 1;
	ctrlFilterDesc.MoveWindow(rc);
	
	// filter edit
	rc.top += 16;
	rc.bottom -= 8;
	rc.left += 8;
	rc.right -= ((rc.right - rc.left - 4) / 3);
	ctrlFilter.MoveWindow(rc);
	
	//filter sel
	rc.bottom += comboH;
	rc.right += ((rc.right - rc.left - 12) / 2) ;
	rc.left += ((rc.right - rc.left + 8) / 3) * 2;
	ctrlFilterSel.MoveWindow(rc);
	
	// Config
	rc.left = rc.right + 10;
	rc.right = rc.left + 160;
	rc.bottom -= comboH;
	
	ctrlConfigure.MoveWindow(rc);
	
	rect.bottom -= 60;
	SetSplitterRect(&rect);
}