コード例 #1
0
ファイル: toolbar.cpp プロジェクト: gloria8023/miranda-ng
//----- Separators -----
void InsertSeparator(int i)
{
	TTBButton ttb = { 0 };
	ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ISSEPARATOR | TTBBF_INTERNAL;
	ttb.wParamDown = i;
	TTBAddButton((WPARAM)&ttb, 0);
}
コード例 #2
0
void InitInternalButtons()
{
	hwndContactTree = pcli->hwndContactTree;

	CreateServiceFunction(TTBI_GROUPSHOWHIDE, TTBInternalGroupShowHide);
	CreateServiceFunction(TTBI_SOUNDSONOFF, TTBInternalSoundsOnOff);
	CreateServiceFunction(TTBI_MAINMENUBUTT, TTBInternalMainMenuButt);
	CreateServiceFunction(TTBI_STATUSMENUBUTT, TTBInternalStatusMenuButt);
	CreateServiceFunction(TTBI_SHOWHIDEOFFLINE, TTBInternalShowHideOffline);

	for (int i = 0; i < _countof(stdButtons); i++) {
		TTBButton ttb = { 0 };
		ttb.name = stdButtons[i].name;
		ttb.pszService = stdButtons[i].pszService;
		ttb.dwFlags = TTBBF_INTERNAL;
		if (stdButtons[i].bDefVisible == TRUE)
			ttb.dwFlags |= TTBBF_VISIBLE;
		if ((ttb.pszTooltipDn = stdButtons[i].tooltipDn) != NULL)
			ttb.dwFlags |= TTBBF_SHOWTOOLTIP;
		ttb.pszTooltipUp = stdButtons[i].tooltipUp;
		if (stdButtons[i].bCustomIcon) {
			ttb.hIconUp = (HICON)LoadImage(hInst, MAKEINTRESOURCE(stdButtons[i].iconidUp), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
			if (stdButtons[i].iconidDn) {
				ttb.dwFlags |= TTBBF_ASPUSHBUTTON;
				ttb.hIconDn = (HICON)LoadImage(hInst, MAKEINTRESOURCE(stdButtons[i].iconidDn), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
			}
			else
				ttb.hIconDn = NULL;
		}
		else {
			ttb.hIconHandleUp = Skin_GetIconHandle(stdButtons[i].iconidUp);
			if (stdButtons[i].iconidDn) {
				ttb.dwFlags |= TTBBF_ASPUSHBUTTON;
				ttb.hIconHandleDn = Skin_GetIconHandle(stdButtons[i].iconidDn);
			}
			else
				ttb.hIconHandleDn = ttb.hIconDn = NULL;
		}

		if (i == 0)
			ttb.wParamUp = 1;

		stdButtons[i].hButton = (HANDLE)TTBAddButton((WPARAM)&ttb, 0);
	}

	CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)stdButtons[INDEX_OFFLINE].hButton,
		db_get_b(NULL, "CList", "HideOffline", 0) ? 0 : TTBST_PUSHED);

	CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)stdButtons[INDEX_GROUPS].hButton,
		db_get_b(NULL, "CList", "UseGroups", 1) ? TTBST_PUSHED : 0);

	CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)stdButtons[INDEX_SOUNDS].hButton,
		db_get_b(NULL, "Skin", "UseSound", 1) ? TTBST_PUSHED : 0);

	CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)stdButtons[INDEX_META].hButton,
		db_get_b(NULL, "MetaContacts", "Enabled", 1) ? TTBST_PUSHED : 0);

	HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnSettingChanging);
}
コード例 #3
0
ファイル: toolbar.cpp プロジェクト: gloria8023/miranda-ng
//----- Service buttons -----
void InsertSBut(int i)
{
	TTBButton ttb = { 0 };
	ttb.hIconDn = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_RUN), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
	ttb.hIconUp = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_RUN), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
	ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ISSBUTTON | TTBBF_INTERNAL;
	ttb.wParamDown = i;
	TTBAddButton((WPARAM)&ttb, 0);
}
コード例 #4
0
ファイル: toolbar.cpp プロジェクト: gloria8023/miranda-ng
void InsertLBut(int i)
{
	TTBButton ttb = { 0 };
	ttb.hIconDn = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_RUN), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
	ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ISLBUTTON | TTBBF_INTERNAL;
	ttb.name = LPGEN("Default");
	ttb.program = _T("Execute Path");
	ttb.wParamDown = i;
	TTBAddButton((WPARAM)&ttb, 0);
}