void CScrollBarUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if( _tcsicmp(pstrName, _T("button1normalimage")) == 0 ) SetButton1NormalImage(pstrValue); else if( _tcsicmp(pstrName, _T("button1hotimage")) == 0 ) SetButton1HotImage(pstrValue); else if( _tcsicmp(pstrName, _T("button1pushedimage")) == 0 ) SetButton1PushedImage(pstrValue); else if( _tcsicmp(pstrName, _T("button1disabledimage")) == 0 ) SetButton1DisabledImage(pstrValue); else if( _tcsicmp(pstrName, _T("button2normalimage")) == 0 ) SetButton2NormalImage(pstrValue); else if( _tcsicmp(pstrName, _T("button2hotimage")) == 0 ) SetButton2HotImage(pstrValue); else if( _tcsicmp(pstrName, _T("button2pushedimage")) == 0 ) SetButton2PushedImage(pstrValue); else if( _tcsicmp(pstrName, _T("button2disabledimage")) == 0 ) SetButton2DisabledImage(pstrValue); else if( _tcsicmp(pstrName, _T("thumbnormalimage")) == 0 ) SetThumbNormalImage(pstrValue); else if( _tcsicmp(pstrName, _T("thumbhotimage")) == 0 ) SetThumbHotImage(pstrValue); else if( _tcsicmp(pstrName, _T("thumbpushedimage")) == 0 ) SetThumbPushedImage(pstrValue); else if( _tcsicmp(pstrName, _T("thumbdisabledimage")) == 0 ) SetThumbDisabledImage(pstrValue); else if( _tcsicmp(pstrName, _T("railnormalimage")) == 0 ) SetRailNormalImage(pstrValue); else if( _tcsicmp(pstrName, _T("railhotimage")) == 0 ) SetRailHotImage(pstrValue); else if( _tcsicmp(pstrName, _T("railpushedimage")) == 0 ) SetRailPushedImage(pstrValue); else if( _tcsicmp(pstrName, _T("raildisabledimage")) == 0 ) SetRailDisabledImage(pstrValue); else if( _tcsicmp(pstrName, _T("bknormalimage")) == 0 ) SetBkNormalImage(pstrValue); else if( _tcsicmp(pstrName, _T("bkhotimage")) == 0 ) SetBkHotImage(pstrValue); else if( _tcsicmp(pstrName, _T("bkpushedimage")) == 0 ) SetBkPushedImage(pstrValue); else if( _tcsicmp(pstrName, _T("bkdisabledimage")) == 0 ) SetBkDisabledImage(pstrValue); else if( _tcsicmp(pstrName, _T("hor")) == 0 ) SetHorizontal(_tcsicmp(pstrValue, _T("true")) == 0); else if( _tcsicmp(pstrName, _T("linesize")) == 0 ) SetLineSize(_ttoi(pstrValue)); else if( _tcsicmp(pstrName, _T("range")) == 0 ) SetScrollRange(_ttoi(pstrValue)); else if( _tcsicmp(pstrName, _T("value")) == 0 ) SetScrollPos(_ttoi(pstrValue)); else if( _tcsicmp(pstrName, _T("showbutton1")) == 0 ) SetShowButton1(_tcsicmp(pstrValue, _T("true")) == 0); else if( _tcsicmp(pstrName, _T("showbutton2")) == 0 ) SetShowButton2(_tcsicmp(pstrValue, _T("true")) == 0); else CControlUI::SetAttribute(pstrName, pstrValue); }
CSize ULTooToolBar::CalcDynamicLayout(int nLength, DWORD dwMode) { // if we're committing set the buttons appropriately if (dwMode & LM_COMMIT) { if (dwMode & LM_VERTDOCK) { if (!m_bVertical) SetVertical(); } else { if (m_bVertical) SetHorizontal(); } return CToolBar::CalcDynamicLayout(nLength, dwMode); } else { BOOL bOld = m_bVertical; BOOL bSwitch = (dwMode & LM_HORZ) ? bOld : !bOld; if (bSwitch) { if (bOld) SetHorizontal(); else SetVertical(); } CSize sizeResult = CToolBar::CalcDynamicLayout(nLength, dwMode); if (bSwitch) { if (bOld) SetHorizontal(); else SetVertical(); } return sizeResult; } }
void CProgressUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if( _tcsicmp(pstrName, _T("hor")) == 0 ) SetHorizontal(_tcsicmp(pstrValue, _T("true")) == 0); else if( _tcsicmp(pstrName, _T("min")) == 0 ) SetMinValue(_ttoi(pstrValue)); else if( _tcsicmp(pstrName, _T("max")) == 0 ) SetMaxValue(_ttoi(pstrValue)); else if( _tcsicmp(pstrName, _T("value")) == 0 ) SetValue(_ttoi(pstrValue)); else if( _tcsicmp(pstrName, _T("isstretchfore"))==0) SetStretchForeImage(_tcsicmp(pstrValue, _T("true")) == 0? true : false); else CLabelUI::SetAttribute(pstrName, pstrValue); }
void CProgressUI::SetAttribute(const wchar_t* pstrName, const wchar_t* pstrValue) { if( wcscmp(pstrName, L"foreimage") == 0 ) m_sForeImage.reset(new CImage(pstrValue)); else if( wcscmp(pstrName, L"hor") == 0 ) SetHorizontal(wcscmp(pstrValue, L"true") == 0); else if( wcscmp(pstrName, L"min") == 0 ) SetMinValue(_wtoi(pstrValue)); else if( wcscmp(pstrName, L"max") == 0 ) SetMaxValue(_wtoi(pstrValue)); else if( wcscmp(pstrName, L"value") == 0 ) SetValue(_wtoi(pstrValue)); else if( wcscmp(pstrName, L"isstretchfore")==0) SetStretchForeImage(wcscmp(pstrValue, L"true") == 0? true : false); else CLabelUI::SetAttribute(pstrName, pstrValue); }
void CUIProgress::SetAttribute(LPCWSTR pstrName, LPCWSTR pstrValue) { if( wcscmp(pstrName, L"foreimage") == 0 ) SetForeImage(pstrValue); else if( wcscmp(pstrName, L"hor") == 0 ) SetHorizontal(wcscmp(pstrValue, L"true") == 0); else if( wcscmp(pstrName, L"min") == 0 ) SetMinValue(/*_wtoi(pstrValue)*/wcstol(pstrValue, NULL, 10)); else if( wcscmp(pstrName, L"max") == 0 ) SetMaxValue(/*_wtoi(pstrValue)*/wcstol(pstrValue, NULL, 10)); else if( wcscmp(pstrName, L"value") == 0 ) SetValue(/*_wtoi(pstrValue)*/wcstol(pstrValue, NULL, 10)); else if( wcscmp(pstrName, L"isstretchfore")==0) SetStretchForeImage(wcscmp(pstrValue, L"true") == 0); else CUILabel::SetAttribute(pstrName, pstrValue); }
BOOL CDoubleThumbOpt::InitThumb(BOOL bHorizontal, int nThumbWidth, CRect& rcChannel) { SetHorizontal(bHorizontal); SetChannelRect(rcChannel); SetThumbWidth(nThumbWidth); CPoint ptCenter; ptCenter = rcChannel.CenterPoint(); if (bHorizontal) { ptCenter.x =rcChannel.left; } else { ptCenter.y = rcChannel.top; } m_ltThumb.InitThumb(ptCenter, 0, THUNMB_RECT_HEIGHT, nThumbWidth, m_bHorizontal); m_rbThumb.InitThumb(ptCenter, 10, THUNMB_RECT_HEIGHT, nThumbWidth, m_bHorizontal); return TRUE; }
BOOL CMultiThumbOpt::InitThumb(BOOL bHorizontal, int nThumbWidth, CRect& rcChannel) { SetHorizontal(bHorizontal); SetChannelRect(rcChannel); SetThumbWidth(nThumbWidth); CPoint ptCenter; ptCenter = rcChannel.CenterPoint(); if (bHorizontal) { ptCenter.x =rcChannel.left; } else { ptCenter.y = rcChannel.top; } ASSERT(m_szThumb.size() <= m_szTicMarks->size()); int nPos = 0; for (UINT i = 0; i < m_szThumb.size(); i++) { nPos = i ; if (m_bHorizontal) { ptCenter.x = m_szTicMarks->at(nPos)+m_rcChannel.left; } else { ptCenter.y = m_szTicMarks->at(nPos)+m_rcChannel.top; } m_szThumb[i]->InitThumb(ptCenter, nPos, THUNMB_RECT_HEIGHT, nThumbWidth, m_bHorizontal); // m_szThumb[i]->SetMixValue(m_nM) } m_nFocusThumb = 0; ReCalcChannelRect(); return TRUE; }
GWEN_CONTROL_CONSTRUCTOR(ProgressBar, Label) { _bar_padding = Gwen::Padding(2, 2, 2, 2); _progress = 0; _maximum_progress = 100; _display_label = true; _as_percentage = true; SetAlignment(Position::CENTER); SetBounds(Rectangle(0, 0, 128, 32)); SetHorizontal(); SetMouseInputEnabled(true); SetTextPadding(Padding(3, 0, 3, 0)); Gwen::Skin::Base* skin = GetSkin(); assert(skin != nullptr); if (skin != nullptr) { SetColor(skin->Colors.ProgressBar.Bar); SetTextColor(skin->Colors.ProgressBar.Text); } }
bool pawsScrollBar::Setup(iDocumentNode* node) { // Check for direction csRef<iDocumentAttribute> directionAttribute = node->GetAttribute("direction"); if(directionAttribute) { csString value(directionAttribute->GetValue()); if(value == "horizontal") SetHorizontal(true); else SetHorizontal(false); } limited = false; csRef<iDocumentAttribute> attr = node->GetAttribute("maxValue"); if(attr) { maxValue = attr->GetValueAsFloat(); limited = true; } attr = node->GetAttribute("minValue"); if(attr) { minValue = attr->GetValueAsFloat(); limited = true; } attr = node->GetAttribute("tick"); if(attr) tickValue = attr->GetValueAsFloat(); // up button settings csRef<iDocumentNode> upNode = node->GetNode("up"); if(upNode) { attr = upNode->GetAttribute("grey"); if(attr) upGrey = attr->GetValue(); attr = upNode->GetAttribute("unpressed"); if(attr) upUnpressed = attr->GetValue(); attr = upNode->GetAttribute("pressed"); if(attr) upPressed = attr->GetValue(); attr = upNode->GetAttribute("offsetx"); if(attr) upOffsetx = attr->GetValueAsInt(); attr = upNode->GetAttribute("offsety"); if(attr) upOffsety = attr->GetValueAsInt(); attr = upNode->GetAttribute("width"); if(attr) upWidth = attr->GetValueAsInt(); attr = upNode->GetAttribute("height"); if(attr) upHeight = attr->GetValueAsInt(); } // down button settings csRef<iDocumentNode> downNode = node->GetNode("down"); if(downNode) { attr = downNode->GetAttribute("grey"); if(attr) downGrey = attr->GetValue(); attr = downNode->GetAttribute("unpressed"); if(attr) downUnpressed = attr->GetValue(); attr = downNode->GetAttribute("pressed"); if(attr) downPressed = attr->GetValue(); attr = downNode->GetAttribute("offsetx"); if(attr) downOffsetx = attr->GetValueAsInt(); attr = downNode->GetAttribute("offsety"); if(attr) downOffsety = attr->GetValueAsInt(); attr = downNode->GetAttribute("width"); if(attr) downWidth = attr->GetValueAsInt(); attr = downNode->GetAttribute("height"); if(attr) downHeight = attr->GetValueAsInt(); } // thumb settings csRef<iDocumentNode> thumbNode = node->GetNode("thumb"); if(thumbNode) { attr = thumbNode->GetAttribute("stopped"); if(attr) thumbStopped = attr->GetValue(); attr = thumbNode->GetAttribute("moving"); if(attr) thumbMoving = attr->GetValue(); } return true; }
void ULTooToolBar::InitControlWithULInfo(CWnd* pParentWnd) { CFDMSApp* pApp = (CFDMSApp*)AfxGetApp(); Create(pParentWnd); LoadToolBar(IDR_TOOLBAR1); DWORD sty = GetBarStyle(); SetBarStyle(sty | CBRS_TOOLTIPS | CBRS_FLYBY); EnableDocking(CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM); SetWindowText(_T("Integrated Tools")); CRect rect(-COMBOBOX_WIDTH, -COMBOBOX_HEIGHT, 0, 0); // The ID of the ComboBox is important for two reasons. One, so you // can receive notifications from the control. And also for ToolTips. // During HitTesting if the ToolBar sees that the mouse is one a child // control, the toolbar will lookup the controls ID and search for a // string in the string table with the same ID to use for ToolTips // and StatusBar info. if (m_ToolBox.Create(WS_CHILD | CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | CBS_HASSTRINGS, rect, this, ID_TOOLCOMBOBOXID)) { HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); if (hFont == NULL) hFont = (HFONT)GetStockObject(ANSI_VAR_FONT); m_ToolBox.SendMessage(WM_SETFONT, (WPARAM)hFont); // determine if UL is available. UINT num_tools = 0; if (pApp->m_pRT_Init != NULL) num_tools = pApp->m_pRT_Init->Get_Tools_Num(); if (num_tools > 0) { const char * tool_name; unsigned int i, j; BOOL tool_status; m_bULToolsAvailable = true; j = 0; for (i=0; i<num_tools; i++) { tool_status = pApp->m_pRT_Init->Get_Tool_Installed (i); if (tool_status == FALSE) continue; tool_status = pApp->m_pRT_Init->Get_Data_Match_Tool (i); if (tool_status == FALSE) continue; tool_name = pApp->m_pRT_Init->Get_Tool_Name (i); m_ToolBox.InsertString(j, tool_name); m_ToolBox.SetItemData(j, i); j++; } } else m_ToolBox.InsertString(0, "None Available"); if (ULSupport::ULIRSDataPath.GetLength() > 5) // need something with suffix at least { // no UL no IRS no FacMgr or whtever so don't bother to check CheckForImportFileExistence(); SetTimer(TIMER_CHECKIMP,21000,0); // check every 21 seconds } } if(!SetHorizontal()) return; }
ASSERTNAME #include "Psd3RuledLineGraphic.h" #include "RailGraphicUtility.h" // A mutli-part graphic header preceeds the actual graphic data in all // types of multi-part graphics. Although the structure of this header // is constant for all multi-part graphics, valid entries in the structure // vary by graphic type. The following documentation lists the valid // combinations of flags and graphics for the RPsd3RuledLineGraphic class, // defined by EPsd3RuledLineElement. // RPsd3MultiPartGraphicHeader members: // uWORD m_PartsList // Indicates existence of a particular piece of a multi-part graphic. // kPsd3RuledLineLeftCap is required. Combinations of other elements may include: // // kPsd3RuledLineRightCap // kPsd3RuledLineRail // // uWORD m_Draw; // Not used by Renaissance. // // uWORD m_Flip; // Indicates that a mirror image of the graphic is to be displayed instead of the original // graphic on opposite ends of the line. The only valid entry in this field is // kPsd3RuledLineLeftCap, which muct be set if kPsd3RuledLineRightCap is not set in m_PartsList. // // uWORD m_Stretch; // Not valid for ruled line graphics. // // uWORD m_Unused[24]; // Not used by Renaissance. // // The graphics are stored in the following order (provided they exist): // // Left cap // Right cap // Rail // **************************************************************************** // // Function Name: RPsd3RuledLineGraphic::RPsd3RuledLineGraphic() // // Description: Constructor // // Returns: Nothing // // Exceptions: None // // **************************************************************************** RPsd3RuledLineGraphic::RPsd3RuledLineGraphic() : kPsd3RuledLineLeftCap(1), kPsd3RuledLineRightCap(2), kPsd3RuledLineRail(4), m_pLeftCap(NULL), m_pRightCap(NULL), m_pRail(NULL), m_fMirrorCaps(FALSE) { SetHorizontal(); }