Esempio n. 1
0
void Config_Render(bool force)
{
	int x, y;
	
	if (force) configdirty = 2;
	if (!configdirty) return;
	configdirty--;
	
	ClearFramebuffer();
	DrawText(2, 2, RGB(255, 255, 255), "blargSNES config");
	
	y = 2 + 12 + 10;
	
	DrawCheckBox(10, y, RGB(255,255,255), "Hardware renderer", Config.HardwareRenderer);
	
	y += 26;
	
	DrawText(10, y+1, RGB(255,255,255), "Scaling:");
	x = 10 + MeasureText("Scaling:") + 6;
	
	char* scalemodes[] = {"1:1", "Fullscreen", "Cropped", "4:3", "Cropped 4:3"};
	int themode = Config.ScaleMode;
	if (themode < 0 || themode > 4) themode = 0;
	DrawButton(x, y-3, 140, RGB(255,255,255), scalemodes[themode]);
	
	
	DrawButton(10, 212, 0, RGB(255,128,128), "Cancel");
	DrawButton(-10, 212, 0, RGB(128,255,128), "Save changes");
}
void mxExpressionTray::DrawThumbNail( CExpClass *active, CExpression *current, CChoreoWidgetDrawHelper& helper, int rcx, int rcy, int rcw, int rch, int c, int selected, bool updateselection )
{
	if ( !current )
		return;

	HDC dc = helper.GrabDC();

	helper.DrawFilledRect( GetSysColor( COLOR_BTNFACE ), rcx, rcy, rcw + rcx, rch + rcy );

	if ( current->m_Bitmap[ models->GetActiveModelIndex() ].valid )
	{
		DrawBitmapToDC( dc, rcx, rcy, rcw, rch - m_nDescriptionHeight, current->m_Bitmap[ models->GetActiveModelIndex() ] );
		helper.DrawOutlinedRect( RGB( 127, 127, 127 ), PS_SOLID, 1, rcx, rcy, rcx + rcw, rcy + rch - m_nDescriptionHeight );
	}

	DrawDirtyFlag( helper, current, rcx, rcy, rcw, rch );

	DrawExpressionDescription( helper, rcx, rcy, rcw, rch, current->name, current->description );

	if ( c == selected )
	{
		DrawExpressionFocusRect( helper, rcx, rcy, rcw, rch - m_nDescriptionHeight, RGB( 255, 100, 63 ) );

		if ( updateselection )
		{
			m_nPrevCell = -1;
			m_nCurCell = c;
		}

		if ( current->CanUndo() || current->CanRedo() )
		{
			if ( current->CanUndo() )
			{
				DrawButton( helper, c, FindButton( "undo" ) );
			}

			if ( current->CanRedo() )
			{
				DrawButton( helper, c, FindButton( "redo" ) );
			}

			RECT rc;
			rc.left =  rcx + rcw - 2 * ( m_nButtonSquare + 4 );
			rc.top = rcy + m_nButtonSquare + 6;
			rc.right = rc.left + 2 * ( m_nButtonSquare + 4 );
			rc.bottom = rc.top + 15;

			helper.DrawColoredText( "Arial", 9, FW_NORMAL, RGB( 200, 200, 200 ), rc, 
				"%i/%i", current->UndoCurrent(), current->UndoLevels() );
		}

	}
	else
	{
		if ( current->GetSelected() )
		{
			DrawExpressionFocusRect( helper, rcx, rcy, rcw, rch - m_nDescriptionHeight, RGB( 127, 127, 220 ) );
		}
	}
}
Esempio n. 3
0
void DrawMessageWindow(char* message_line1, char* message_line2,
                       char* message_line3, char buttons)
{
  SetFont(SMALL_FONT);
  LcdSetColor(WHITE);
  LcdRect(5, 9, 123, 54);
  LcdSetColor(BLACK);
  
  LcdLine(6,   9,   122, 9);
  LcdLine(6,   55,  122, 55);
  LcdLine(4,   11,  4,   53);
  LcdLine(124, 11,  124, 53);
  
  LcdLine(5,   10,  5,   10);
  LcdLine(5,   54,  5,   54);
  LcdLine(123, 10,  123, 10);
  LcdLine(123, 54,  123, 54);
  
  LcdBmp(6, 26, BMP_EXLAMATION_WIDTH, BMP_EXLAMATION_HEIGHT, bmp_exlamation); 
  //LcdBmp(6, 26, BMP_KEY_INPUT_WIDTH, BMP_KEY_INPUT_HEIGHT, bmp_key_input); 
  
  LcdText(29, 12, 122, 18, message_line1);
  LcdText(29, 21, 122, 27, message_line2);
  LcdText(29, 30, 122, 36, message_line3);
  
  if(buttons & MB_OK)
    DrawButton(29, 40, BTN_OK, mw_focus == 0);
  if(buttons & MB_CANCEL)
    DrawButton(75, 40, BTN_CANCEL, mw_focus == 1);
};
Esempio n. 4
0
void CBfDrawButton::OnPaint()
{
	if (IsMouseDown())
	{
		DrawButton(Color(44, 98, 139),
			Color(229, 244, 252), Color(196, 229, 246),
			Color(152, 209, 239), Color(104, 179, 219),
			Color(100, 52, 87, 114), Color(52, 87, 114), RGB(212, 212, 212));
	}
	else
	{
		if (IsMouseHover())
		{
			DrawButton(Color(60, 127, 177),
				Color(234, 246, 253), Color(217, 240, 252),
				Color(190, 230, 253), Color(167, 217, 245),
				Color(100, 105, 150, 184), Color(105, 150, 184), RGB(255, 255, 255));
		}
		else
		{
			DrawButton(Color(112, 112, 112),
				Color(242, 242, 242), Color(235, 235, 235),
				Color(221, 221, 221), Color(207, 207, 207),
				Color(100, 145, 145, 145), Color(145, 145, 145), RGB(255, 255, 255));
		}
	}
}
Esempio n. 5
0
static VOID DrawGhosted(struct TB_Element *tool, struct Toolbar_Data *data, Object *obj, BOOL selected)
{
  switch(data->GhostEffect)
  {
    case GHOST_LIGHT:
    case GHOST_HEAVY:
    {
      DrawButton(tool, data, obj, selected, !data->ToolImages);

      if(data->ToolImages)
      {
        struct RastPort *rport = &data->RP;
        USHORT ditherData[2];

        if(data->GhostEffect == GHOST_LIGHT)
        {
          ditherData[0] = 0x8888;
          ditherData[1] = 0x2222;
        }
        else
        {
          ditherData[0] = 0x5555;
          ditherData[1] = 0xAAAA;
        }

        SetAPen(rport, _pens(obj)[MPEN_SHADOW]);
        SetAfPt(rport, ditherData, 1);
        RectFill(rport, tool->DstX, tool->DstY, tool->DstX+data->ButtonWidth-1, tool->DstY + data->ButtonHeight-1);
        SetAfPt(rport, NULL, 0);
      }
    }
    break;
    case GHOST_SUPERLIGHT:
    {
      DrawButton(tool, data, obj, selected, THREE_D);

      if(data->ToolImages)
      {
        struct RastPort *rport = &data->RP;
        USHORT ditherData[] = {0x5555, 0xAAAA};
        SetAPen(rport, _pens(obj)[MPEN_HALFSHINE]);
        SetAfPt(rport, ditherData, 1);
        RectFill(rport, tool->DstX+2, tool->DstY+2, tool->DstX+data->ButtonWidth-3, tool->DstY+1+data->InnerSpace+data->IconHeight);
        SetAfPt(rport, NULL, 0);
      }
    }
    break;
    case GHOST_BITMAP:
//    case GHOST_DIMMED:
    {
      DrawButton(tool, data, obj, selected, THREE_D);
    }
    break;
  }
}
Esempio n. 6
0
void ProfileMatchView::PaintButtons(const QVector<int> &demandIndex, const QVector<int> &supplyIndex) 
{
//	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
	QPen pen(Qt::red, 3);
	QBrush brush(Qt::yellow);

	//run through all the buttons and highlight those selected.
	for (int i=0;i<dPButtonList.count();++i)
	{
		QRect Rect1 = QRect(dPButtonList[i]->x(), dPButtonList[i]->y(),
			dPButtonList[i]->width(),dPButtonList[i]->height());
		for (int q = 0; q < demandIndex.size(); q++)
		{
			if (i == demandIndex[q])
			{
				m_bDemandSelected = true;
				DrawButton(Rect1,brush);
				int nSupplies=0;
				//lines between demand & supply
				for (int j=0;j<sPButtonList.count();++j)
				{
					QRect Rect2 = QRect(sPButtonList[j]->x(), sPButtonList[j]->y(),
						sPButtonList[j]->width(),sPButtonList[j]->height());
					for (int q = 0; q < supplyIndex.size(); q++)
					{
						if (j == supplyIndex[q])
						{
							++nSupplies;
							DrawLine(Rect1,Rect2,pen);
						}
					}
				}
			}
		}
	}

// run through all the supply button and highlight those selected
	for (int i=0;i<sPButtonList.count();++i)
	{
		QRect Rect2 = QRect(sPButtonList[i]->x(), sPButtonList[i]->y(),
			sPButtonList[i]->width(),sPButtonList[i]->height());
		for (int q = 0; q < supplyIndex.size(); q++)
		{
			if (i == supplyIndex[q])
			{
				m_bSupplySelected = true;
				DrawButton(Rect2,brush);
			}
		}
	}

//	QApplication::restoreOverrideCursor(); 
}
Esempio n. 7
0
void COXTabViewContainer::DrawScrollButtons(CDC* pDC)
{
	ASSERT_VALID(pDC);

	// scroll to start button
	DrawButton(pDC,m_rectScrollToStartBtn,SCRLSTARTBTN);
	// scroll backward button
	DrawButton(pDC,m_rectScrollBackwardBtn,SCRLBACKWARDBTN);
	// scroll forward button
	DrawButton(pDC,m_rectScrollForwardBtn,SCRLFORWARDBTN);
	// scroll to end button
	DrawButton(pDC,m_rectScrollToEndBtn,SCRLENDBTN);
}
 void SH_BT_HVVP_Active()
  {
  SH_BT_HVVP1.Visible = 1;
  SH_BT_HVVP2.Visible = 1;
  SH_BT_HVVN2.Visible = 1;
  SH_BT_HVVN1.Visible = 1;
  SH_BT_HVCP1.Visible = 1;
  SH_BT_HVCP2.Visible = 1;
  SH_BT_HVCN2.Visible = 1;
  SH_BT_HVCN1.Visible = 1;
 DrawButton(&SH_BT_HVVP1);
 DrawButton(&SH_BT_HVVP2);
 DrawButton(&SH_BT_HVVN1);
 DrawButton(&SH_BT_HVVN2);
 DrawButton(&SH_BT_HVCP1);
 DrawButton(&SH_BT_HVCP2);
 DrawButton(&SH_BT_HVCN2);
 DrawButton(&SH_BT_HVCN1);
  SH_BT_HVVP1.Active = 1;
  SH_BT_HVVP2.Active = 1;
  SH_BT_HVVN2.Active = 1;
  SH_BT_HVVN1.Active = 1;
  SH_BT_HVCP1.Active = 1;
  SH_BT_HVCP2.Active = 1;
  SH_BT_HVCN2.Active = 1;
  SH_BT_HVCN1.Active = 1;
 }
Esempio n. 9
0
static void FakeKeyboardPress(struct Control* control)
{
  struct CommandButton* button = (struct CommandButton*)control->ControlData;

  DrawButton(control->posx+1, control->posy, button->len,
        control->forcolor, button->highcolor, button->caption, 
        TRUE, FALSE);

  delay(100);

  DrawButton(control->posx, control->posy, button->len,
        control->forcolor, button->highcolor, button->caption, 
        TRUE, TRUE);
}
Esempio n. 10
0
/** Draw the buttons on the dialog window. */
void DrawButtons(void)
{

    ButtonNode button;
    int temp;

    Assert(dialog);

    dialog->buttonWidth = GetStringWidth(FONT_MENU, GetCancelString());
    temp = GetStringWidth(FONT_MENU, GetOKString());
    if(temp > dialog->buttonWidth) {
        dialog->buttonWidth = temp;
    }
    dialog->buttonWidth += 16;
    dialog->buttonHeight = dialog->lineHeight + 4;

    ResetButton(&button, dialog->pmap);
    button.border = 1;
    button.font = FONT_MENU;
    button.width = dialog->buttonWidth;
    button.height = dialog->buttonHeight;
    button.alignment = ALIGN_CENTER;

    dialog->okx = dialog->width / 3 - dialog->buttonWidth / 2;
    dialog->cancelx = 2 * dialog->width / 3 - dialog->buttonWidth / 2;
    dialog->buttony = dialog->height - dialog->lineHeight
                      - dialog->lineHeight / 2;

    if(dialog->buttonState == DBS_OK) {
        button.type = BUTTON_MENU_ACTIVE;
    } else {
        button.type = BUTTON_MENU;
    }
    button.text = GetOKString();
    button.x = dialog->okx;
    button.y = dialog->buttony;
    DrawButton(&button);

    if(dialog->buttonState == DBS_CANCEL) {
        button.type = BUTTON_MENU_ACTIVE;
    } else {
        button.type = BUTTON_MENU;
    }
    button.text = GetCancelString();
    button.x = dialog->cancelx;
    button.y = dialog->buttony;
    DrawButton(&button);

}
Esempio n. 11
0
static int FakeMousePress(struct Control* control)
{
  int i, wait=TRUE, x, y, status;

  struct CommandButton* button = (struct CommandButton*)control->ControlData;

  ClearMouse();
  DrawButton(control->posx+1, control->posy, button->len,
        control->forcolor, button->highcolor, button->caption, 
        TRUE, FALSE);

  status = DOWN;
  
  while (wait)
        for (i = 0; i < GetNumSupportedButtons(); i++)
            if (MouseReleased(i))
               wait = FALSE;
            else
            {
               WhereMouse(&x, &y);

               if ((x < control->posx) || (x > control->posx+button->len) ||
                   (y < control->posy) || (y > control->posy))
               {
                  if (status == DOWN)
                  {
                     status = UP;
                     DrawButton(control->posx, control->posy, button->len,
                                control->forcolor, button->highcolor, button->caption,
                                TRUE, TRUE);
                  }
               }
               else if (status == UP)
               {
                  status = DOWN;

                  DrawButton(control->posx+1, control->posy, button->len,
                             control->forcolor, button->highcolor, button->caption,
                             TRUE, FALSE);
               }
            }

/*
  DrawButton(control->posx, control->posy, button->len,
        control->forcolor, button->highcolor, button->caption, 
        TRUE, TRUE);
*/
  return status == DOWN;
}
Esempio n. 12
0
void SpinButton::Draw(BRect updateRect)
{
    BRect rect = Bounds();

    if (IsFocus()) {
        SetHighColor(ui_color(B_KEYBOARD_NAVIGATION_COLOR));
        StrokeRect(rect);
    }
    else {
        DrawButton(rect, kSpinButtonNone);
    }

    DrawButton(ButtonFrame(kSpinButtonUp), kSpinButtonUp);
    DrawButton(ButtonFrame(kSpinButtonDown), kSpinButtonDown);
}
Esempio n. 13
0
// Mission Screen Draw logic
void DrawMissionScreen(void)
{
    // Draw MISSION screen here!
    DrawTexture(texBackground, 0,0, WHITE);
    DrawTexturePro(texBackline, sourceRecBackLine, destRecBackLine, (Vector2){0,0},0, Fade(WHITE, fadeBackLine));

    if (writeNumber) DrawTextEx(fontMission, FormatText("Filtración #%02i ", currentMission + 1), numberPosition, missionSize + 10, 0, numberColor);
    DrawTextEx(fontMission, TextSubtext(missions[currentMission].brief, 0, missionLenght), missionPosition, missionSize, 0, missionColor);
    if (writeKeyword && blinkKeyWord) DrawTextEx(fontMission, FormatText("Keyword: %s", missions[currentMission].key), keywordPosition, missionSize + 10, 0, keywordColor);

    if (showButton)
    {
        if (!writeEnd) DrawButton("saltar");
        else DrawButton("codificar");
    }
}
void CTranAnalysisToolBar::OnPaint()
{
    CPaintDC dc(this); // device context for painting

    DrawButton();
    UpdateView();
}
Esempio n. 15
0
void CButton::Draw() 
{
	float bz = GetBufferedZ();

	CGUISpriteInstance *sprite, *sprite_over, *sprite_pressed, *sprite_disabled;
	int cell_id;

	// Statically initialise some strings, so we don't have to do
	// lots of allocation every time this function is called
	static CStr strSprite("sprite");
	static CStr strSpriteOver("sprite_over");
	static CStr strSpritePressed("sprite_pressed");
	static CStr strSpriteDisabled("sprite_disabled");
	static CStr strCellId("cell_id");

	GUI<CGUISpriteInstance>::GetSettingPointer(this, strSprite, sprite);
	GUI<CGUISpriteInstance>::GetSettingPointer(this, strSpriteOver, sprite_over);
	GUI<CGUISpriteInstance>::GetSettingPointer(this, strSpritePressed, sprite_pressed);
	GUI<CGUISpriteInstance>::GetSettingPointer(this, strSpriteDisabled, sprite_disabled);
	GUI<int>::GetSetting(this, strCellId, cell_id);

	DrawButton(m_CachedActualSize,
			   bz,
			   *sprite,
			   *sprite_over,
			   *sprite_pressed,
			   *sprite_disabled,
			   cell_id);

	CColor color = ChooseColor();
	IGUITextOwner::Draw(0, color, m_TextPos, bz+0.1f);
}
Esempio n. 16
0
ENDDISPATCH

/*	XGToolbarView::DoPeriodic
 *
 *		Handle periodic events
 */

long XGToolbarView::DoPeriodic(long,void *)
{
	long i,len;
	autoptr<XGDraw> draw;
	char c;
	
	/*
	 *	Scan all the commands and figure out their status
	 */
	
	len = fStatus.GetSize();
	for (i = 0; i < len; i++) {
		c = GetMenuStatus(GetItemCommand(i));
		if (c != fStatus.GetChar(i)) {
			if (NULL == draw.Ptr()) draw = new XGDraw(this);
			fStatus.SetChar(i,c);
			DrawButton(*draw,
					   CalcButton(i),
					   i,
					   c);
		}
	}
	return 0;
}
Esempio n. 17
0
bool XGToolbarView::DoMouseDown(Point where, short)
{
	long i,len;
	XRect r;
	unsigned char c;
	
	XGToolTip::CloseTip();
	len = fStatus.GetSize();
	for (i = 0; i < len; i++) {
		r = CalcButton(i);
		if (PtInRect(where,&r)) {
			c = fStatus.GetChar(i);
			if (c & kSkip) return false;			
			if (0 == (c & kEnable)) return false;		// not enabled.
			fHitStatus = true;
			fHitWhat = i;
			fHitWhere = r;
			fHitMode = c;
			
			XGDraw draw(this);
			DrawButton(draw,r,fHitWhat,c | kDown);
			return true;
		}
	}
	return false;
}
Esempio n. 18
0
void DrawWindow(struct Context *context) {

    struct Button *but;
    int r;

    XSync(display,1);

    /*DrawPlate(0,0,WINDOW_W-1,WINDOW_H-1,WHITE,PLATE_UP);
    DrawPlate(0,0,WINDOW_W-1,WINDOW_H-1,BLACK,PLATE_UP);*/
    Color(BLACK);
    FillRectangle(WINDOW_H,WINDOW_H-120,WINDOW_W-1,WINDOW_H-1);

    NetDisplay();

  //NR: Number of robots, r: robot number (do it NR times)
    for (r=0;r<NR;r++) {
        RobotDisplay(r,robots[r]);
    }

    but = context->Buttons;;
    while (but) {
        DrawButton(but);
        but = but->Next;
    }

    XSync(display,0);
}
void CXTPSkinObjectToolBar::DrawToolbarH(CDC* pDC)
{
	CToolBarCtrl* pToolBar = (CToolBarCtrl*)this;

	int nCount = pToolBar->GetButtonCount();

	for (int nIndex = 0; nIndex < nCount; nIndex++)
	{
		TBBUTTON tbb;
		if (!pToolBar->GetButton(nIndex, &tbb))
			continue;

		if (tbb.fsState & TBSTATE_HIDDEN)
			continue;

		if (tbb.fsStyle & TBSTYLE_SEP)
		{
			CXTPSkinManagerClass* pClass = GetSkinClass();

			CRect rc;
			pToolBar->GetItemRect(nIndex, &rc);

			pClass->DrawThemeBackground(pDC, TP_SEPARATOR,
				0, &rc);

		}
		else
		{
			DrawButton(pDC, nIndex);
		}
	}
}
Esempio n. 20
0
void CEnEdit::NcPaint(CDC* pDC, const CRect& rWindow)
{
	CPoint ptCursor(::GetMessagePos());
	int nBtn = m_aButtons.GetSize();
	
	while (nBtn--)
		DrawButton(pDC, rWindow, nBtn, ptCursor);
}
void Button_Panel::Paint()
{
	BaseClass::Paint();

	DrawButton();
	DrawText();
	DrawDescription();
}
Esempio n. 22
0
static void DrawCmdButton(struct Control* control)
{
  struct CommandButton* button = (struct CommandButton*)control->ControlData;

  DrawButton(control->posx, control->posy, button->len,
        control->forcolor, control->backcolor, button->caption, 
        FALSE, TRUE);
}
Esempio n. 23
0
void CMyButton::OnEnable(BOOL bEnable)
{
	CButton::OnEnable(bEnable);

	// TODO: Add your message handler code here
	m_bDisable=IsWindowEnabled()?FALSE:TRUE;  
	DrawButton();
}
Esempio n. 24
0
void UpdateWindow()
{
	int i;
	for(i=0;i<IndexButtonInArray;i++)	
		DrawButton(i);
	
	End();	
}
Esempio n. 25
0
/** Draw the buttons on the dialog window. */
void DrawButtons(DialogType *dp) {

   ButtonNode button;
   int temp;

   Assert(dp);

   dp->buttonWidth = GetStringWidth(FONT_MENU, CANCEL_STRING);
   temp = GetStringWidth(FONT_MENU, OK_STRING);
   if(temp > dp->buttonWidth) {
      dp->buttonWidth = temp;
   }
   dp->buttonWidth += 16;
   dp->buttonHeight = dp->lineHeight + 4;

   ResetButton(&button, dp->node->window, rootGC);
   button.font = FONT_MENU;
   button.width = dp->buttonWidth;
   button.height = dp->buttonHeight;
   button.alignment = ALIGN_CENTER;

   dp->okx = dp->width / 3 - dp->buttonWidth / 2;
   dp->cancelx = 2 * dp->width / 3 - dp->buttonWidth / 2;
   dp->buttony = dp->height - dp->lineHeight - dp->lineHeight / 2;

   if(dp->buttonState == DBS_OK) {
      button.type = BUTTON_TASK_ACTIVE;
   } else {
      button.type = BUTTON_TASK;
   }
   button.text = OK_STRING;
   button.x = dp->okx;
   button.y = dp->buttony;
   DrawButton(&button);

   if(dp->buttonState == DBS_CANCEL) {
      button.type = BUTTON_TASK_ACTIVE;
   } else {
      button.type = BUTTON_TASK;
   }
   button.text = CANCEL_STRING;
   button.x = dp->cancelx;
   button.y = dp->buttony;
   DrawButton(&button);

}
Esempio n. 26
0
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
	case WM_CREATE:
		{
			hBtnDraw = CreateWindowExW(WS_EX_APPWINDOW
			, L"BUTTON", NULL
			, WS_CHILD | WS_VISIBLE | BS_OWNERDRAW
			, 10, 10, 80, 30
			, hWnd, (HMENU)DRAW, hInst, NULL); 

			hBtnClear = CreateWindowExW(WS_EX_APPWINDOW
			, L"BUTTON", NULL
			, WS_CHILD | WS_VISIBLE | BS_OWNERDRAW
			, 10, 50, 80, 30
			, hWnd, (HMENU)CLEAR, hInst, NULL); 

			break;
		}
	case WM_DRAWITEM: 
		{
			int itemId = wParam;
			LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
			DrawButton(dis);
			break;
		}
	case WM_COMMAND:
		{
			switch(LOWORD(wParam))
			{
			case DRAW:
				{
					isDrawn = TRUE;
					DrawPicture(hWnd);
					break;
				}
			case CLEAR:
				{
					isDrawn = FALSE;
					DrawPicture(hWnd);
					break;
				}
			}
			break;
		}
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
        break;
    }

    return 0;
}
Esempio n. 27
0
void wcSliderButton::OnMouseMove(UINT nFlags, CPoint point) 
{
	CEdit::OnMouseMove(nFlags, point);

	// presses and releases the button as the mouse is moved over and
	// off the button. we check the current button state to avoid
	// unnecessary flicker
	if (m_bMouseCaptured)
	{
		ClientToScreen(&point);
		if (ScreenPointInButtonRect(point))
		{
			if (m_nButtonState != BTN_DOWN)
				DrawButton (BTN_DOWN);
		}
		else if (m_nButtonState != BTN_UP)
			DrawButton (BTN_UP);
	}
}
Esempio n. 28
0
LONG wcSliderButton::OnSliderClose(UINT lParam, LONG wParam)
{
	DrawButton (BTN_UP);
    CWnd *pParent = GetParent();
    if (pParent) {
        pParent->SendMessage(CSP_CLOSEUP, lParam, (WPARAM) GetDlgCtrlID());
    }

    return TRUE;
}
Esempio n. 29
0
static void OnEntering(struct Control* control)
{
  struct CommandButton* button = (struct CommandButton*)control->ControlData;

  DrawButton(control->posx, control->posy, button->len,
        control->forcolor, button->highcolor, button->caption, 
        TRUE, TRUE);

  control->active = TRUE;
}
Esempio n. 30
0
static void OnLeaving(struct Control* control)
{
  struct CommandButton* button = (struct CommandButton*)control->ControlData;

  DrawButton(control->posx, control->posy, button->len,
        control->forcolor, control->backcolor, button->caption, 
        control->DefaultControl, TRUE);

  control->active = FALSE;
}