Ejemplo n.º 1
0
void UploadQueueFrame::UpdateLayout(BOOL bResizeBars /* = TRUE */) {
	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);

		w[0] = 16;

		ctrlStatus.SetParts(4, w);

		ctrlStatus.GetRect(0, sr);
		ctrlShowTree.MoveWindow(sr);
	}
	if(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);
}
Ejemplo n.º 2
0
void CChildFrame::UpdateLayout(BOOL bResizeBars) 
{ 
    RECT rect = { 0 }; 
    GetClientRect(&rect); 
    // position bars and offset their dimensions 
    UpdateBarsPosition(rect, bResizeBars); 
    SetSplitterRect(&rect); 
} 
Ejemplo n.º 3
0
LRESULT CModelRawHierView::OnCreate (UINT uMsg, 
	WPARAM wParam, LPARAM lParam, BOOL &bHandled) 
{

	//
	// Create the treeview
	//

	m_wnd .Create (m_hWnd, rcDefault, _T (""), 
		WS_CHILD | WS_VISIBLE, WS_EX_CLIENTEDGE, (HMENU) 0, 0);

	//
	// Create the text window
	//

	m_wndText .Create (m_hWnd, rcDefault, _T (""),
		WS_CHILD | WS_VISIBLE, WS_EX_CLIENTEDGE, (HMENU) 0, 0);

	//
	// Set the size of the splitter
	//

	SetSplitterExtendedStyle (0, SPLIT_PROPORTIONAL);
	CRect rect (0, 0, 1000, 1000);
	SetSplitterRect (rect);
	SetSplitterPos (250);

	//
	// Set the splitter panes
	//

	SetSplitterPanes (m_wnd .m_hWnd, m_wndText .m_hWnd);
	bHandled = FALSE;

	//
	// Update bottom
	//

	OnNodeChange (0, TVI_ROOT);
	return TRUE;
}
Ejemplo n.º 4
0
void HubChatFrame::UpdateLayout(BOOL /*bResizeBars*/) {
  RECT r;
  GetClientRect(&r);
  SetSplitterRect(&r);
}
Ejemplo n.º 5
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);
}
Ejemplo n.º 6
0
LRESULT MainWindowPageScripts::MainWindowPageProc(UINT uMsg, WPARAM wParam, LPARAM lParam) {
    switch(uMsg) {
        case WM_SETFOCUS: {
            CHARRANGE cr = { 0, 0 };
            ::SendMessage(hWndPageItems[REDT_SCRIPTS_ERRORS], EM_EXSETSEL, 0, (LPARAM)&cr);
            ::SetFocus(hWndPageItems[REDT_SCRIPTS_ERRORS]);
            return 0;
		}
        case WM_WINDOWPOSCHANGED: {
            RECT rcMain = { 0, 0, ((WINDOWPOS*)lParam)->cx, ((WINDOWPOS*)lParam)->cy };
            SetSplitterRect(&rcMain);

            return 0;
        }
        case WM_COMMAND:
            switch(LOWORD(wParam)) {
                case BTN_OPEN_SCRIPT_EDITOR: {
                    OpenScriptEditor();
                    return 0;
                }
                case BTN_REFRESH_SCRIPTS:
                    RefreshScripts();
                    return 0;
                case BTN_MOVE_UP:
                    MoveUp();
                    return 0;
                case BTN_MOVE_DOWN:
                    MoveDown();
                    return 0;
                case BTN_RESTART_SCRIPTS:
                    RestartScripts();
                    return 0;
                case IDC_OPEN_IN_EXT_EDITOR:
                    OpenInExternalEditor();
                    return 0;
                case IDC_OPEN_IN_SCRIPT_EDITOR:
                    OpenInScriptEditor();
                    return 0;
                case IDC_DELETE_SCRIPT:
                    DeleteScript();
                    return 0;
            }

            if(RichEditCheckMenuCommands(hWndPageItems[REDT_SCRIPTS_ERRORS], LOWORD(wParam)) == true) {
                return 0;
            }

            break;
        case WM_CONTEXTMENU:
            OnContextMenu((HWND)wParam, lParam);
            break;
        case WM_NOTIFY:
            if(((LPNMHDR)lParam)->hwndFrom == hWndPageItems[LV_SCRIPTS]) {
                if(((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) {
                    OnItemChanged((LPNMLISTVIEW)lParam);
                } else if(((LPNMHDR)lParam)->code == NM_DBLCLK) {
                    if(((LPNMITEMACTIVATE)lParam)->iItem == -1) {
                        break;
                    }

                    OnDoubleClick((LPNMITEMACTIVATE)lParam);

                    return 0;
                }
            } else if(((LPNMHDR)lParam)->hwndFrom == hWndPageItems[REDT_SCRIPTS_ERRORS] && ((LPNMHDR)lParam)->code == EN_LINK) {
                if(((ENLINK *)lParam)->msg == WM_LBUTTONUP) {
                    RichEditOpenLink(pMainWindowPageScripts->hWndPageItems[MainWindowPageScripts::REDT_SCRIPTS_ERRORS], (ENLINK *)lParam);
                    return 1;
                }
            }

            break;
        case WM_DESTROY:
            g_GuiSettingManager->SetInteger(GUISETINT_SCRIPTS_SPLITTER, iPercentagePos);
            g_GuiSettingManager->SetInteger(GUISETINT_SCRIPT_NAMES, (int)::SendMessage(hWndPageItems[LV_SCRIPTS], LVM_GETCOLUMNWIDTH, 0, 0));
            g_GuiSettingManager->SetInteger(GUISETINT_SCRIPT_MEMORY_USAGES, (int)::SendMessage(hWndPageItems[LV_SCRIPTS], LVM_GETCOLUMNWIDTH, 1, 0));

            break;
    }

    if(BasicSplitterProc(uMsg, wParam, lParam) == true) {
    	return 0;
    }

	return ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
}
Ejemplo n.º 7
0
bool MainWindowPageScripts::CreateMainWindowPage(HWND hOwner) {
    CreateHWND(hOwner);

    RECT rcMain;
    ::GetClientRect(m_hWnd, &rcMain);

    hWndPageItems[GB_SCRIPTS_ERRORS] = ::CreateWindowEx(WS_EX_TRANSPARENT, WC_BUTTON, LanguageManager->sTexts[LAN_SCRIPTS_ERRORS],
        WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | BS_GROUPBOX, 3, 0, rcMain.right - ScaleGui(145) - 9, rcMain.bottom - 3, m_hWnd, NULL, g_hInstance, NULL);

    hWndPageItems[REDT_SCRIPTS_ERRORS] = ::CreateWindowEx(WS_EX_CLIENTEDGE, /*MSFTEDIT_CLASS*/RICHEDIT_CLASS, "", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_READONLY,
        11, iGroupBoxMargin, rcMain.right - ScaleGui(145) - 25, rcMain.bottom - (iGroupBoxMargin + 11), m_hWnd, (HMENU)REDT_SCRIPTS_ERRORS, g_hInstance, NULL);
    ::SendMessage(hWndPageItems[REDT_SCRIPTS_ERRORS], EM_EXLIMITTEXT, 0, (LPARAM)1048576);
    ::SendMessage(hWndPageItems[REDT_SCRIPTS_ERRORS], EM_AUTOURLDETECT, TRUE, 0);
    ::SendMessage(hWndPageItems[REDT_SCRIPTS_ERRORS], EM_SETEVENTMASK, 0, (LPARAM)::SendMessage(hWndPageItems[REDT_SCRIPTS_ERRORS], EM_GETEVENTMASK, 0, 0) | ENM_LINK);

    hWndPageItems[BTN_OPEN_SCRIPT_EDITOR] = ::CreateWindowEx(0, WC_BUTTON, LanguageManager->sTexts[LAN_OPEN_SCRIPT_EDITOR], WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON,
        rcMain.right - ScaleGui(145) - 4, 1, ScaleGui(145) + 2, iEditHeight, m_hWnd, (HMENU)BTN_OPEN_SCRIPT_EDITOR, g_hInstance, NULL);

    hWndPageItems[BTN_REFRESH_SCRIPTS] = ::CreateWindowEx(0, WC_BUTTON, LanguageManager->sTexts[LAN_REFRESH_SCRIPTS], WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON,
        rcMain.right - ScaleGui(145) - 4, iEditHeight + 4, ScaleGui(145) + 2, iEditHeight, m_hWnd, (HMENU)BTN_REFRESH_SCRIPTS, g_hInstance, NULL);

    hWndPageItems[LV_SCRIPTS] = ::CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, "", WS_CHILD | WS_VISIBLE | WS_TABSTOP | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL,
        rcMain.right - ScaleGui(145) - 3, (2 * iEditHeight) + 8, ScaleGui(145), rcMain.bottom - ((2 * iEditHeight) + 8) - ((2 * iEditHeight) - 5) - 14, m_hWnd, NULL, g_hInstance, NULL);
    ::SendMessage(hWndPageItems[LV_SCRIPTS], LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_LABELTIP | LVS_EX_CHECKBOXES);

    hWndPageItems[BTN_MOVE_UP] = ::CreateWindowEx(0, WC_BUTTON, LanguageManager->sTexts[LAN_MOVE_UP], WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP | BS_PUSHBUTTON,
        rcMain.right - ScaleGui(145) - 4, rcMain.bottom - (2 * iEditHeight) - 5, ScaleGui(72), iEditHeight, m_hWnd, (HMENU)BTN_MOVE_UP, g_hInstance, NULL);

    hWndPageItems[BTN_MOVE_DOWN] = ::CreateWindowEx(0, WC_BUTTON, LanguageManager->sTexts[LAN_MOVE_DOWN], WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP | BS_PUSHBUTTON,
        rcMain.right - ScaleGui(72) - 2, rcMain.bottom - (2 * iEditHeight) - 5, ScaleGui(72), iEditHeight, m_hWnd, (HMENU)BTN_MOVE_DOWN, g_hInstance, NULL);

    {
        DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON;
        if(SettingManager->bBools[SETBOOL_ENABLE_SCRIPTING] == false || bServerRunning == false) {
            dwStyle |= WS_DISABLED;
        }

        hWndPageItems[BTN_RESTART_SCRIPTS] = ::CreateWindowEx(0, WC_BUTTON, LanguageManager->sTexts[LAN_RESTART_SCRIPTS], dwStyle,
            rcMain.right - ScaleGui(145) - 4, rcMain.bottom - iEditHeight - 2, ScaleGui(145) + 2, iEditHeight, m_hWnd, (HMENU)BTN_RESTART_SCRIPTS, g_hInstance, NULL);
    }

    for(uint8_t ui8i = 0; ui8i < (sizeof(hWndPageItems) / sizeof(hWndPageItems[0])); ui8i++) {
        if(hWndPageItems[ui8i] == NULL) {
            return false;
        }

        ::SendMessage(hWndPageItems[ui8i], WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
    }

    SetSplitterRect(&rcMain);

    LVCOLUMN lvColumn = { 0 };
    lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
    lvColumn.fmt = LVCFMT_LEFT;
    lvColumn.cx = g_GuiSettingManager->iIntegers[GUISETINT_SCRIPT_NAMES];
    lvColumn.pszText = LanguageManager->sTexts[LAN_SCRIPT_FILE];
    lvColumn.iSubItem = 0;

    ::SendMessage(hWndPageItems[LV_SCRIPTS], LVM_INSERTCOLUMN, 0, (LPARAM)&lvColumn);

    lvColumn.fmt = LVCFMT_RIGHT;
    lvColumn.cx = g_GuiSettingManager->iIntegers[GUISETINT_SCRIPT_MEMORY_USAGES];
    lvColumn.pszText = LanguageManager->sTexts[LAN_MEM_USAGE];
    lvColumn.iSubItem = 1;
    ::SendMessage(hWndPageItems[LV_SCRIPTS], LVM_INSERTCOLUMN, 1, (LPARAM)&lvColumn);

	AddScriptsToList(false);

    wpOldMultiRichEditProc = (WNDPROC)::SetWindowLongPtr(hWndPageItems[REDT_SCRIPTS_ERRORS], GWLP_WNDPROC, (LONG_PTR)MultiRichEditProc);

    ::SetWindowLongPtr(hWndPageItems[LV_SCRIPTS], GWLP_USERDATA, (LONG_PTR)this);
    wpOldButtonProc = (WNDPROC)::SetWindowLongPtr(hWndPageItems[LV_SCRIPTS], GWLP_WNDPROC, (LONG_PTR)ScriptsProc);

    ::SetWindowLongPtr(hWndPageItems[BTN_MOVE_UP], GWLP_USERDATA, (LONG_PTR)this);
    wpOldButtonProc = (WNDPROC)::SetWindowLongPtr(hWndPageItems[BTN_MOVE_UP], GWLP_WNDPROC, (LONG_PTR)MoveUpProc);

    ::SetWindowLongPtr(hWndPageItems[BTN_MOVE_DOWN], GWLP_USERDATA, (LONG_PTR)this);
    wpOldButtonProc = (WNDPROC)::SetWindowLongPtr(hWndPageItems[BTN_MOVE_DOWN], GWLP_WNDPROC, (LONG_PTR)MoveDownProc);

    wpOldButtonProc = (WNDPROC)::SetWindowLongPtr(hWndPageItems[BTN_RESTART_SCRIPTS], GWLP_WNDPROC, (LONG_PTR)LastButtonProc);

	return true;
}