Пример #1
0
// AddStop
void
SVGGradient::AddStop(float offset, rgba8 color)
{
	if (!fGradient)
		fGradient = MakeGradient();

	rgb_color c = { color.r, color.g, color.b, color.a };
	fGradient->AddColor(c, offset);
}
Пример #2
0
// SetTransformation
void
SVGGradient::SetTransformation(const trans_affine& transform)
{
//printf("SVGGradient::SetTransformation()\n");
	if (!fGradient)
		fGradient = MakeGradient();

	fGradient->multiply(transform);
}
Пример #3
0
void MenuItem::Paint(HDC hDC)
{
	RECT rect;

	COLORREF cr0 = (COLORREF)-1;
	bool lit = false;
	StyleItem *pSI = &mStyle.MenuFrame;

	if (m_bActive && 0 == (m_isNOP & (MI_NOP_TEXT | MI_NOP_SEP)) && (0 == (m_isNOP & MI_NOP_DISABLED) || m_pSubMenu))
	{
		// draw hilite bar
		GetItemRect(&rect);
		pSI = &mStyle.MenuHilite;
		MakeStyleGradient(hDC, &rect, pSI, pSI->bordered);
		cr0 = SetTextColor(hDC, pSI->TextColor);
		lit = true;
	}
	else
		if (m_isNOP & MI_NOP_DISABLED)
		{
			cr0 = SetTextColor(hDC, mStyle.MenuFrame.disabledColor);
		}

	//dbg_printf("Menu separator style is: %s",Settings_menuSeparatorStyle);

	// draw separator
	if (m_isNOP & MI_NOP_LINE)
	{
		int x, y = m_nTop + m_nHeight / 2;
		// Noccy: Looks like we have to remove some pixels here to prevent it from overwriting the right border.
		int left  = m_nLeft + ((Settings_menuFullSeparatorWidth)?1:mStyle.MenuSepMargin) - 1;
		int right = m_nLeft + m_nWidth - ((Settings_menuFullSeparatorWidth)?1:mStyle.MenuSepMargin);
		// int dist = (m_nWidth + 1) / 2 - ((Settings_menuFullSeparatorWidth==true)?mStyle.MenuFrame.borderWidth:mStyle.MenuSepMargin);
		int dist = (m_nWidth+1) / 2 - ((Settings_menuFullSeparatorWidth)?1:mStyle.MenuSepMargin);
		COLORREF c = mStyle.MenuSepColor;
		COLORREF cs = pSI->ShadowColor;

		if (pSI->ShadowXY)
		{
			int yS = y + pSI->ShadowY;
			int leftS  = left + pSI->ShadowX;
			int rightS = right + pSI->ShadowX;
			if (0 == stricmp(Settings_menuSeparatorStyle,"gradient"))
			{
				// Gradient shadow
				for (x = 0; x <= dist; ++x)
				{
					int pos, hue = x * 255 / dist;
					pos = leftS + x;
					SetPixel(hDC, pos, yS, mixcolors(cs, GetPixel(hDC, pos, y), hue));
					pos = rightS - x;
					SetPixel(hDC, pos, yS, mixcolors(cs, GetPixel(hDC, pos, y), hue));
				}
			}
			else
				if (0 == stricmp(Settings_menuSeparatorStyle,"flat"))
				{
					// Flat shadow
					for (x = 0; x <= dist; ++x)
					{
						int pos;
						pos = leftS + x;
						SetPixel(hDC, pos, yS, cs);
						pos = rightS - x;
						SetPixel(hDC, pos, yS, cs);
					}
				}
				else
					if (0 == stricmp(Settings_menuSeparatorStyle,"bevel"))
					{
						// Bevel shadow is simply none...
					}
		}
		if (0 == stricmp(Settings_menuSeparatorStyle,"gradient"))
		{
			for (x = 0; x <= dist; ++x)
			{
				int pos, hue = x * 255 / dist;
				pos = left + x;
				SetPixel(hDC, pos, y, mixcolors(c, GetPixel(hDC, pos, y), hue));
				pos = right - x;
				SetPixel(hDC, pos, y, mixcolors(c, GetPixel(hDC, pos, y), hue));
			}
		}
		else
			if (0 == stricmp(Settings_menuSeparatorStyle,"flat"))
			{
				for (x = 0; x <= dist; ++x)
				{
					int pos; //, hue = x * 255 / dist;
					pos = left + x;
					SetPixel(hDC, pos, y, c);
					pos = right - x;
					SetPixel(hDC, pos, y, c);
				}
			}
			else
				if (0 == stricmp(Settings_menuSeparatorStyle,"bevel"))
				{
					for (x = 0; x <= dist; ++x)
					{
						int pos;
						pos = left + x;
						SetPixel(hDC, pos, y, mixcolors(0x00000000, GetPixel(hDC, pos, y), 160));
						pos = right - x;
						SetPixel(hDC, pos, y, mixcolors(0x00000000, GetPixel(hDC, pos, y), 160));
						pos = left + x;
						SetPixel(hDC, pos, y+1, mixcolors(0x00FFFFFF, GetPixel(hDC, pos, y+1), 160));
						pos = right - x;
						SetPixel(hDC, pos, y+1, mixcolors(0x00FFFFFF, GetPixel(hDC, pos, y+1), 160));
					}
				}
	}

	int iconSize = m_pMenu->m_iconSize;
	if (-2 == iconSize) iconSize = MenuInfo.nIconSize;
	GetTextRect(&rect, iconSize);

	// [load and ]draw menu item icon
	if (iconSize)
	{
		bool bSmallIcon = (16 >= iconSize);
		// load menu item icon
		if (NULL == m_hIcon || bSmallIcon != m_bSmallIcon)
		{
			DestroyIcon(m_hIcon), m_hIcon = NULL;
			m_bSmallIcon = bSmallIcon;
			switch (m_iconMode)
			{
			case IM_PIDL:
			{
				const _ITEMIDLIST *pidl = (MENUITEM_ID_SF == m_ItemID) ?
										  ((SpecialFolderItem*)this)->check_pidl() : m_pidl;

				if (pidl)
				{
					SHFILEINFO sfi;
					HIMAGELIST sysimgl = (HIMAGELIST)SHGetFileInfo((LPCSTR)pidl, 0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | (bSmallIcon ? SHGFI_SMALLICON : SHGFI_LARGEICON));
					if (sysimgl) m_hIcon = ImageList_GetIcon(sysimgl, sfi.iIcon, ILD_NORMAL);
				}
			}
			break;

			case IM_TASK:
			{
				const struct tasklist *tl = (struct tasklist *)m_im_stuff;
				m_hIcon = CopyIcon(bSmallIcon ? tl->icon : tl->icon_big);
			}
			break;

			case IM_PATH:
				char *icon = (char *)m_im_stuff;
				char *path = strrchr(icon, ',');
				int idx;
				if (path)
					idx = atoi(path + 1), *path = 0;
				else
					idx = 0;
				if (bSmallIcon)
					ExtractIconEx(icon, idx, NULL, &m_hIcon, 1);
				else
					ExtractIconEx(icon, idx, &m_hIcon, NULL, 1);
				if (path) *path = ',';
				break;
			}
		}

		// draw menu item icon
		if (m_hIcon)
		{
			int top = rect.top + (m_nHeight - iconSize) / 2;
			int adjust = (MenuInfo.nItemIndent[iconSize] - iconSize) / 2;
			int left = ((DT_LEFT == FolderItem::m_nBulletPosition) ? rect.right : m_nLeft) + adjust;
			drawIco(left, top, iconSize, m_hIcon, hDC, !m_bActive, Settings_menuIconSaturation, Settings_menuIconHue);
		}
	}


	/*
		Noccy: Added DT_NOPREFIX to BBDrawText to prevent ampersand (&) to be interpreted as
		a hotkey.
		Note: Reverted.
	*/

	// draw menu item text
	const char *title = GetDisplayString();

	if (0 == (m_ItemID & (~MENUITEM_ID_CI & (MENUITEM_ID_CIInt|MENUITEM_ID_CIStr))) || Settings_menusBroamMode)
		BBDrawText(hDC, title, -1, &rect, mStyle.MenuFrame.Justify | DT_MENU_STANDARD, pSI);
	else
		if (m_ItemID != MENUITEM_ID_CIStr)
			BBDrawText(hDC, title, -1, &rect, DT_CENTER | DT_MENU_STANDARD, pSI);

	// set back previous textColor
	if ((COLORREF)-1 != cr0) SetTextColor(hDC, cr0);

	if (m_isChecked) // draw check-mark
	{
		pSI = &mStyle.MenuHilite;
		bool pr = pSI->parentRelative;
		if (lit != pr) pSI = &mStyle.MenuFrame;

		int x, y = m_nTop + m_nHeight / 2;
		if ((FolderItem::m_nBulletPosition == DT_RIGHT) == (0 == (MENUITEM_ID_FOLDER & m_ItemID)))
			x = m_nLeft + m_nWidth - MenuInfo.nItemIndent[iconSize] / 2 - 1;
		else
			x = m_nLeft + MenuInfo.nItemIndent[iconSize] / 2;

		const int r = 3;
		rect.left   = x - r;
		rect.right  = x + r;
		rect.top    = y - r;
		rect.bottom = y + r;

		if (pr) MakeGradient(hDC, rect, B_SOLID, pSI->TextColor, 0, false, BEVEL_FLAT, 0, 0, 0, 0);
		else MakeStyleGradient(hDC, &rect, pSI, false);
	}
}
Пример #4
0
void MenuItem::Paint(HDC hDC)
{
    RECT rc, rhi;
    StyleItem *pSI;
    COLORREF TC, BC;
    int j;

    GetTextRect(&rc);
    pSI = &mStyle.MenuFrame;

    if (m_bActive && false == m_bNOP) {
        // draw hilite bar
        GetItemRect(&rhi);
        pSI = &mStyle.MenuHilite;
        MakeStyleGradient(hDC, &rhi, pSI, pSI->bordered);
        TC = pSI->TextColor;
        BC = pSI->foregroundColor;
    } else if (m_bDisabled) {
        BC = TC = pSI->disabledColor;
    } else {
        TC = pSI->TextColor;
        BC = pSI->foregroundColor;
    }

    j = m_Justify;
    if (MENUITEM_CUSTOMTEXT != j) {
        if (MENUITEM_STANDARD_JUSTIFY == j)
            j = mStyle.MenuFrame.Justify;
        // draw menu item text
        //bbDrawText(hDC, GetDisplayString(), &rc, j | DT_MENU_STANDARD, TC);
		/* BlackboxZero 1.5.2012 */
		BBDrawText(hDC, GetDisplayString(), -1, &rc, j | DT_MENU_STANDARD, pSI);
    }

//#ifdef BBOPT_MENUICONS
	if ( Settings_menu.iconSize ) /* BlackboxZero 1.3.2012 */
		this->DrawIcon(hDC);
//#endif

    if (m_bChecked) // draw check-mark
    {
        int d, atright;

//#ifdef BBOPT_MENUICONS
		if ( Settings_menu.iconSize ) { /* BlackboxZero 1.3.2012 */
			if (m_ItemID & MENUITEM_ID_FOLDER)
				atright = MenuInfo.nBulletPosition == FOLDER_LEFT;
			else
				atright = true;
		} else {
//#else
			if (MenuInfo.nItemLeftIndent != MenuInfo.nItemRightIndent)
				atright = MenuInfo.nBulletPosition != FOLDER_LEFT;
			else
			if (m_ItemID & MENUITEM_ID_FOLDER)
				atright = MenuInfo.nBulletPosition == FOLDER_LEFT;
			else
				atright = j != DT_LEFT;
		}
//#endif
        rc.bottom = (rc.top = m_nTop) + m_nHeight + 1;
        if (atright) {
            d = MenuInfo.nItemRightIndent + mStyle.MenuHilite.borderWidth;
            rc.left = (rc.right = m_nLeft + m_nWidth) - d + 1;
        } else {
            d = MenuInfo.nItemLeftIndent + mStyle.MenuHilite.borderWidth;
            rc.right = (rc.left = m_nLeft) + d;
        }

#if 1
        bbDrawPix(hDC, &rc, BC, BS_CHECK);
#else
        {
            bool pr, lit;
            const int w = 6;
            pSI = &mStyle.MenuHilite;
            pr = pSI->parentRelative;
            lit = m_bActive && false == m_bNOP;
            if (lit != pr)
                pSI = &mStyle.MenuFrame;
            rc.left   = (rc.left + rc.right - w)/2;
            rc.right  = rc.left + w;
            rc.top    = (rc.top + rc.bottom - w)/2;
            rc.bottom = rc.top + w;
            if (pr)
                MakeGradient(hDC, rc, B_SOLID, pSI->TextColor, 0, false, BEVEL_FLAT, 0, 0, 0, 0);
            else
                MakeStyleGradient(hDC, &rc, pSI, false);
        }
#endif
    }
}
Пример #5
0
//===========================================================================
LRESULT CALLBACK EditProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
		case WM_SETFOCUS:
		{
			SendMessage(hwndBBNoter,EM_SETSEL,0,-1);
			mySetTimer();
//			pBBox->ToggleSlitAutoHide(true);
		}
		break;

		case WM_KILLFOCUS:
		{
			KillTimer(hwndBBNoter, IDT_TIMER);
//			pBBox->ResetHistoryIndex();
		//	pBBox->ToggleSlitAutoHide(false);
		}
		break;

		case WM_NCHITTEST:
		{
			if((GetAsyncKeyState(VK_CONTROL) & 0x8000))
				return HTCAPTION;
		}
		break;

		case WM_NCRBUTTONUP:
		//	return pBBox->RButtonDown(hText, msg, wParam, lParam);
			createMenu();
		
		case WM_KEYDOWN:
		{
		/*	if(wParam==VK_DOWN)
			{
	//			pBBox->HistoryPrev();
				return 0;
			}
			if(wParam==VK_UP)
			{
		//		pBBox->HistoryNext();
				return 0;
			}
			if(KEY_CHECK(wParam))
		*/		InvalidateRect(hwndBBNoter, NULL, true);
		}
		break;

		case WM_CHAR:
		{
			/*if(wParam==VK_RETURN)
			{
			//	pBBox->Execute();
			//	pBBox->ToggleSlitAutoHide(false);
				
				InvalidateRect(hwndBBNoter, NULL, true);

			//	return 0;
			}*/
			
		}
		break;

		case WM_CLOSE: { return 0; } break; // no ALT+F4

		//gr

		case WM_TIMER:
		{
			switch (wParam)
			{
				case IDT_TIMER:
				{
					//redraw the window
					line = SendMessage(hwndBBNoter,EM_GETFIRSTVISIBLELINE,0,0);
					if (lastLine != line) InvalidateRect(hwndBBNoter, NULL, false);
					lastLine = line;
				} break;
			}
		}
		break;
		case WM_PAINT:
		{
			// Create buffer hdc's, bitmaps etc.
			PAINTSTRUCT ps;  RECT r;

			//get screen buffer
            HDC hdc_scrn = BeginPaint(hwnd, &ps);

			//retrieve the coordinates of the window's client area.
			GetClientRect(hwnd, &r);

			//to prevent flicker of the display, we draw to memory first,
            //then put it on screen in one single operation. This is like this:

            //first get a new 'device context'
			HDC hdc = CreateCompatibleDC(NULL);

			
			HBITMAP bufbmp = CreateCompatibleBitmap(hdc_scrn, r.right, r.bottom);
            SelectObject(hdc, bufbmp);
			
			
			if(drawBorder)
			{
				//Make background gradient
				if ((!(fullTrans && (dwId == VER_PLATFORM_WIN32_NT)&&(dwMajorVer > 4)))||(inSlit))
				{

				MakeGradient(hdc, r, myStyleItem->type,
							backColor, backColorTo,
							myStyleItem->interlaced,
							myStyleItem->bevelstyle,
							myStyleItem->bevelposition,
							bevelWidth, borderColor,
							borderWidth);
				}
				
				// if we draw border we have to make the painting rectangle smaller
				r.left = r.left + (bevelWidth + borderWidth);
				r.top = r.top + (bevelWidth + borderWidth);
				r.bottom = (r.bottom - (bevelWidth + borderWidth));
				r.right = (r.right - (bevelWidth + borderWidth));
			}
			

			SetBkMode(hdc, TRANSPARENT);
		
			

			// if fultrans the whole backgorund is painted pink

			if (fullTrans && (dwId == VER_PLATFORM_WIN32_NT)&&(dwMajorVer > 4))
				{
					HBRUSH hbOrig, hBrush;
					GetClientRect(hwnd, &rect);
					hBrush = CreateSolidBrush(0xFF00FF);
					hbOrig = (HBRUSH)SelectObject(hdc, hBrush);
					Rectangle(hdc, -1,-1,rect.right+1, rect.bottom+1);
					DeleteObject(hBrush);
					DeleteObject(hbOrig);
				}
	
			
					
				/*	HGDIOBJ otherfont = CreateFont( 13, 
						0, 0, 0, FW_NORMAL,
						false, false, false,
						DEFAULT_CHARSET,
						OUT_DEFAULT_PRECIS,
						CLIP_DEFAULT_PRECIS,
						DEFAULT_QUALITY,
						DEFAULT_PITCH,
						fontFace);
					SendMessage(hwnd, WM_SETFONT, (WPARAM)otherfont, FALSE);
					SelectObject(hdc, otherfont);
					SetTextColor(hdc,fontColor);*/
									
					
				POINT poloha;
				GetCursorPos(&poloha);

				

				// if a bitmap path is found the bitmap is painter
			
					if (!strcmp(bitmapFile,".none")==0) 
						{
					
					HANDLE image;
					image = LoadImage(NULL, bitmapFile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
					
					HDC hdcMem = CreateCompatibleDC(hdc);
					
					HBITMAP old = (HBITMAP) SelectObject(hdcMem, image);
					BITMAP bitmap;
					GetObject(image, sizeof(BITMAP), &bitmap);

	
					TransparentBlt(hdc, 0, 0, width, height, hdcMem, 0, 0, bitmap.bmWidth, bitmap.bmHeight, 0xff00ff);
					SelectObject(hdcMem, old);
					DeleteObject(old);
					DeleteObject(image);
					DeleteDC(hdcMem);
					
						}
					else 
							
			// the second background is painted

					if ((!(fullTrans && (dwId == VER_PLATFORM_WIN32_NT)&&(dwMajorVer > 4)))||(inSlit))
					{
				
					MakeGradient(hdc, r, myStyleItem2->type,
							backColor2, backColorTo2,
							myStyleItem2->interlaced,
							myStyleItem2->bevelstyle,
							myStyleItem2->bevelposition,
							bevelWidth, borderColor, 0); 
					}
				

		//		sprintf(szTemp,"X:%i Y:%i",poloha.x,poloha.y);
		//		DrawText(hdc,szTemp,-1,&r,DT_BOTTOM | DT_CENTER | DT_SINGLELINE);


				//Paint to the screen
			//	DeleteObject(otherfont);

				CallWindowProc(wpEditProc, hwnd, message, (WPARAM)hdc, lParam);

				BitBlt(hdc_scrn, 0, 0, width, height, hdc, 0, 0, SRCCOPY);
			
			
			// Remember to delete all objects!
			
			SelectObject(hdc, bufbmp); //mortar: select just incase it is no longer in the context
			DeleteDC(hdc);         //gdi: first delete the dc
			DeleteObject(bufbmp);  //gdi: now the bmp is free

			//takes care of hdc_scrn
			EndPaint(hwnd, &ps);

			return 0;
		}
		break;

		case WM_CTLCOLOREDIT:
		{
			//grSetTextColor((HDC)wParam, fontColor);
			SetTextColor((HDC)wParam, 0xffffff);
			SetBkMode((HDC)wParam, TRANSPARENT);
			return (LRESULT)GetStockObject(NULL_BRUSH);
		}
		break;

		case WM_ERASEBKGND:
			return TRUE;

		case BB_BROADCAST:
		{
			strcpy(szTemp, (LPCSTR)lParam);
		
			if (!_stricmp(szTemp, "@BBShowPlugins") &&  pluginToggle && !inSlit)
			{
				// Show window and force update...
				ShowWindow( hwndBBNoter, SW_SHOW);
				InvalidateRect( hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBHidePlugins") &&  pluginToggle && !inSlit)
			{
				// Hide window...
				ShowWindow( hwndBBNoter, SW_HIDE);
			}
			else if (!_stricmp(szTemp, "@BBNoterAbout"))
			{
				sprintf(szTemp, "%s\n\n%s ©2004 %s\n\n%s",
						szVersion, szInfoAuthor, szInfoEmail, szInfoLink);

				CMessageBox box(hwndBBNoter,				// hWnd
								_T(szTemp),					// Text
								_T(szAppName),				// Caption
								MB_OK | MB_SETFOREGROUND);	// type

				box.SetIcon(IDI_ICON1, hInstance);
				box.DoModal();
				
			}
			else if (!_stricmp(szTemp, "@BBNoterPluginToggle"))
			{
				// Hide window...
				pluginToggle = !pluginToggle;
			}
			else if (!_stricmp(szTemp, "@BBNoterOnTop"))
			{
				// Always on top...
				alwaysOnTop = !alwaysOnTop;

				if (alwaysOnTop && !inSlit) SetWindowPos(hwndBBNoter, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
				else SetWindowPos(hwndBBNoter, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
			}
			else if (!_stricmp(szTemp, "@BBNoterSlit"))
			{
				// Does user want it in the slit...
				wantInSlit = !wantInSlit;

				inSlit = wantInSlit;
				if(wantInSlit && hSlit)
					SendMessage(hSlit, SLIT_ADD, NULL, (LPARAM)hwndBBNoter);
				else if(!wantInSlit && hSlit)
					SendMessage(hSlit, SLIT_REMOVE, NULL, (LPARAM)hwndBBNoter);
				else
					inSlit = false;	

				setStatus();

				GetStyleSettings();
				//update window
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBNoterTransparent"))
			{
				// Set the transparent attributes to the window
				transparency = !transparency;
				setStatus();
			}

			else if (!_stricmp(szTemp, "@BBNoterFullTrans"))
			{
				// Set the transparent bacground attribut to the window
				fullTrans = !fullTrans;
				setStatus();
			}

			else if (!_stricmp(szTemp, "@BBNoterSnapToEdge"))
			{
				// Set the snapWindow attributes to the window
				snapWindow = !snapWindow;
			}
			else if (!_stricmp(szTemp, "@BBNoterDrawBorder"))
			{
				drawBorder = !drawBorder;
				GetClientRect(hwnd, &r);

				if(drawBorder)
				{
				r.left = r.left + (bevelWidth + borderWidth);
				r.top = r.top + (bevelWidth + borderWidth);
				r.bottom = (r.bottom - (bevelWidth + borderWidth));
				r.right = (r.right - (bevelWidth + borderWidth));
				}
				SendMessage(hwndBBNoter, EM_SETRECT, 0, (LPARAM)&r);
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBNoterNoBitmap"))
			{
				noBitmap = true;
				strcpy(bitmapFile, ".none");

				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBNoterStyleLabel"))
			{
				// Set the label attributes to the window style
				strcpy(windowStyle, "label");
				GetStyleSettings();
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBNoterStyleToolbar"))
			{
				// Set the label attributes to the window style
				strcpy(windowStyle, "toolbar");
				GetStyleSettings();
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBNoterStyleButton"))
			{
				// Set the label attributes to the window style
				strcpy(windowStyle, "buttonnp");
				GetStyleSettings();
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBNoterStyleButtonPr"))
			{
				// Set the label attributes to the window style
				strcpy(windowStyle, "buttonpr");
				GetStyleSettings();
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBNoterStyleWindowLabel"))
			{
				// Set the windowLabel attributes to the window style
				strcpy(windowStyle, "windowlabel");
				GetStyleSettings();
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBNoterStyleClock"))
			{
				// Set the clock attributes to the window style
				strcpy(windowStyle, "clock");
				GetStyleSettings();
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBNoterEditRC"))
			{
				BBExecute(GetDesktopWindow(), NULL, rcpath, NULL, NULL, SW_SHOWNORMAL, false);
			}
			else if (!_stricmp(szTemp, "@BBNoterReloadSettings"))
			{
				
				{
					//remove from slit before resetting window attributes
					if(inSlit && hSlit)
						SendMessage(hSlit, SLIT_REMOVE, NULL, (LPARAM)hwndBBNoter);

					//Re-initialize
					ReadRCSettings();
					InitBBNoter();
					inSlit = wantInSlit;
					GetStyleSettings();
					
					setStatus();

					//set window on top is alwaysontop: is true
					if ( alwaysOnTop) SetWindowPos( hwndBBNoter, HWND_TOPMOST, xpos, ypos, width, height, SWP_NOACTIVATE);
					else SetWindowPos( hwndBBNoter, HWND_NOTOPMOST, xpos, ypos, width, height, SWP_NOACTIVATE);

					if(inSlit && hSlit)
						SendMessage(hSlit, SLIT_ADD, NULL, (LPARAM)hwndBBNoter);
					else inSlit = false;

					//update window
					InvalidateRect(hwndBBNoter, NULL, true);
				}
			}
			else if (!_stricmp(szTemp, "@BBNoterSaveSettings"))
			{
				WriteRCSettings();
			}
			else if (!_strnicmp(szTemp, "@BBNoterFontSize", 18))
			{
				fontSize = atoi(szTemp + 19);
				
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_strnicmp(szTemp, "@BBNoterWidth", 15))
			{ //changing the clock size
				width = atoi(szTemp + 16);
				
				if ( alwaysOnTop) SetWindowPos( hwndBBNoter, HWND_TOPMOST, xpos, ypos, width, height, SWP_NOACTIVATE);
				else SetWindowPos( hwndBBNoter, HWND_NOTOPMOST, xpos, ypos, width, height, SWP_NOACTIVATE);

				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_strnicmp(szTemp, "@BBNoterHeight", 16))
			{ //changing the clock size
				height = atoi(szTemp + 17);
									
				if ( alwaysOnTop) SetWindowPos( hwndBBNoter, HWND_TOPMOST, xpos, ypos, width, height, SWP_NOACTIVATE);
				else SetWindowPos( hwndBBNoter, HWND_NOTOPMOST, xpos, ypos, width, height, SWP_NOACTIVATE);

				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_strnicmp(szTemp, "@BBNoterSetTransparent", 24))
			{
				alpha = atoi(szTemp + 25);
			
				if (transparency) setStatus();					
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_strnicmp(szTemp, "@BBNoterSetBitmap", 18))
			{
				
				strcpy(bitmapFile,szTemp + 20);
				noBitmap = false;
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_strnicmp(szTemp, "@BBNoterRatio", 15))
			{
				ratio = atoi(szTemp + 16);
			
				InvalidateRect(hwndBBNoter, NULL, true);
			}
			else if (!_stricmp(szTemp, "@BBNoterLoadBitmap"))
			{
				
			OPENFILENAME ofn;       // common dialog box structure

			// Initialize OPENFILENAME
			ZeroMemory(&ofn, sizeof(ofn));
			ofn.lStructSize = sizeof(ofn);
			ofn.hwndOwner = hwndBBNoter;
			ofn.lpstrFile = bitmapFile;
			ofn.nMaxFile = sizeof(bitmapFile);
			ofn.nFilterIndex = 1;
			ofn.lpstrFileTitle = NULL;
			ofn.nMaxFileTitle = 0;
			ofn.lpstrFilter = "Bitmaps (*.bmp)\0*.bmp\0All Files (*.*)\0*.*\0";
//			ofn.lpstrInitialDir = defaultpath;
//			ofn.lpstrTitle = title;
//			ofn.lpstrDefExt = defaultextension;	

			ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
			if (GetOpenFileName(&ofn)) noBitmap = false;

			InvalidateRect(hwndBBNoter, NULL, true);

			}
		}
		return 0;

		case BB_RECONFIGURE:
		{
			
					//remove from slit before resetting window attributes
					if(inSlit && hSlit)
						SendMessage(hSlit, SLIT_REMOVE, NULL, (LPARAM)hwndBBNoter);

					//Re-initialize
					ReadRCSettings();
					InitBBNoter();
					inSlit = wantInSlit;
					GetStyleSettings();
					
					setStatus();

					//set window on top is alwaysontop: is true
					if ( alwaysOnTop) SetWindowPos( hwndBBNoter, HWND_TOPMOST, xpos, ypos, width, height, SWP_NOACTIVATE);
					else SetWindowPos( hwndBBNoter, HWND_NOTOPMOST, xpos, ypos, width, height, SWP_NOACTIVATE);

					if(inSlit && hSlit)
						SendMessage(hSlit, SLIT_ADD, NULL, (LPARAM)hwndBBNoter);
					else inSlit = false;

					//update window
					InvalidateRect(hwndBBNoter, NULL, true);
				
		}
		return 0;
	}
	return CallWindowProc(wpEditProc,hwndBBNoter,message,wParam,lParam);
}