void CEditTile::SetupSpace(void) { SmartBox *pBox; SmartDialog *pDialog; pDialog = ADerefAs(SmartDialog, gDialog); SetColors(CI_WHITE, CI_BLACK, CI_BLACK); sprintf(szSpaceNum, "%d", SpaceNum); gSpaceNum = pDialog->AddSmartBox(45, 75, szSpaceNum, 3); gBoxes[BoxCount++] = gSpaceNum; pBox = ADerefAs(SmartBox, gSpaceNum); pBox->SetupReplies(gSelf, TEXT_CHANGED); if(!SpaceNum) return; SetupSpaceFunc(); SetupSpaceHot(); SetupRandomItem(); SetupSpecialItem(); sprintf(szSpaceHP, "%d", currSpace.h.maxHP); gBoxes[BoxCount++] = pDialog->AddSmartBox(195, 101, szSpaceHP, 5); /* sprintf(szSpaceX, "%d", currSpace.h.xPos); gBoxes[BoxCount++] = pDialog->AddSmartBox(90, 88, szSpaceX, 3); sprintf(szSpaceY, "%d", currSpace.h.yPos); gBoxes[BoxCount++] = pDialog->AddSmartBox(140, 88, szSpaceY, 3); */ sprintf(szHotX, "%d", currSpace.h.hotX); gHotX = pDialog->AddSmartBox(90, 101, szHotX, 3); gBoxes[BoxCount++] = gHotX; sprintf(szHotY, "%d", currSpace.h.hotY); gHotY = pDialog->AddSmartBox(140, 101, szHotY, 3); gBoxes[BoxCount++] = gHotY; sprintf(szItem, "%d", currSpace.h.presetItem); gItem = pDialog->AddSmartBox(45, 127, szItem, 3); gBoxes[BoxCount++] = gItem; sprintf(szDestX, "%d", currSpace.h.destX); gDestX = pDialog->AddSmartBox(45, 153, szDestX, 4); gBoxes[BoxCount++] = gDestX; sprintf(szDestY, "%d", currSpace.h.destY); gDestY = pDialog->AddSmartBox(140, 153, szDestY, 4); gBoxes[BoxCount++] = gDestY; sprintf(szOwner, "%d", currSpace.h.owner); gOwner = pDialog->AddSmartBox(235, 153, szOwner, 2); gBoxes[BoxCount++] = gOwner; SetColors(CI_WHITE, CI_BLACK, CI_BLACK); }
void __fastcall TfrmCheckBoxes::SetParameters(AnsiString ASelectValue, AnsiString AMultiSelectValue, bool ABlackAndWhite) { TColor ARGBColors[3] = {clRed, clYellow, clLime}; TColor ABlackAndWhiteColors[3] = {TColor(0x828282), TColor(0xF8F8F8), TColor(0xDCDCDC)}; if (ABlackAndWhite) SetColors(ABlackAndWhiteColors, ASelectValue, AMultiSelectValue); else SetColors(ARGBColors, ASelectValue, AMultiSelectValue); }
//*************************************************************************************** void CBCGPRadialMenuObject::SetColorTheme(ColorTheme theme) { switch (theme) { case BCGP_COLOR_THEME_VISUAL_MANAGER: SetColors( globalData.clrBarFace, globalData.clrBarShadow, #ifndef _BCGSUITE_ CBCGPVisualManager::GetInstance()->GetHighlightedColor(0), CBCGPVisualManager::GetInstance()->GetHighlightedColor(1)); #else globalData.clrHilite, globalData.clrHilite); #endif break; case BCGP_COLOR_THEME_BLUE: SetColors( CBCGPColor::LightSteelBlue, CBCGPColor::LightSteelBlue, CBCGPColor::LightSteelBlue, CBCGPColor::LightSteelBlue); break; case BCGP_COLOR_THEME_GREEN: SetColors( CBCGPColor::DarkSeaGreen, CBCGPColor::DarkSeaGreen, CBCGPColor::DarkSeaGreen, CBCGPColor::DarkSeaGreen); break; case BCGP_COLOR_THEME_SILVER: SetColors( CBCGPColor::Silver, CBCGPColor::Silver, CBCGPColor::Orange, CBCGPColor::DarkOrange); break; case BCGP_COLOR_THEME_BLACK: SetColors( CBCGPColor::DarkSlateGray, CBCGPColor::DarkSlateGray, CBCGPColor::DarkSlateGray, CBCGPColor::DarkSlateGray); break; } }
bool Cursor::ReadBin(ResourceData *rd) { Point pt; pt.x = rd->GetByte(); pt.y = rd->GetByte(); SetColors(rd->GetByte()); rd->GetByte(); Point pt1; pt1.x = rd->GetWord(); pt1.y = rd->GetWord(); SetHotspot(pt1); int bytes = rd->GetDWord(); int offset = rd->GetDWord(); if (!pt.x) pt.x = 32; if (!pt.y) pt.y = (bytes - 0x30) / ((pt.x / 8) *2); SetSize(pt); data = new ResourceData(rd->GetData() + offset, bytes); if (rd->PastEnd() || offset + bytes > rd->GetLen()) throw new std::runtime_error("Cursor file too short"); return true; }
// Draws the component void TEXTBOX::Draw(){ SetColors(); int x = this->position.X-1; int y = this->position.Y-1; SetCursor(x, y); printf("%c", '\xDA'); for (int i = x + 1; i < x + length + 1; i++){ SetCursor(i, y); printf("%c", '\xC4'); } SetCursor((x + length + 1), y); printf("%c", '\xBF'); // SetCursor(x, y + 1); printf("%c", '\xB3'); for (int i = x + 1; i < x + length + 1; i++){ SetCursor(i, y + 1); printf("%c", ' '); } SetCursor((x + length + 1), y + 1); printf("%c", '\xB3'); // SetCursor(x, y + 2); printf("%c", '\xC0'); for (int i = x + 1; i < x + length + 1; i++){ SetCursor(i, y + 2); printf("%c", '\xC4'); } SetCursor((x + length + 1), y + 2); printf("%c", '\xD9'); SetCursor(x + 1, y + 1); }
// Handle and events void TEXTBOX::Handle(INPUT_RECORD *inpt, int i){ switch (inpt[i].EventType) { case KEY_EVENT: // keyboard input { KEY_EVENT_RECORD ker = inpt[i].Event.KeyEvent; if (ker.bKeyDown && this->focus){ switch (ker.wVirtualKeyCode){ case VK_BACK: BackSpace(); break; case VK_RIGHT: case VK_NUMPAD6: MoveRight(); break; case VK_LEFT: case VK_NUMPAD4: MoveLeft(); break; case VK_RETURN: break; case VK_DELETE: Delete(); break; default: if ((ker.wVirtualKeyCode >= 65 && ker.wVirtualKeyCode <= 90) || (ker.wVirtualKeyCode >= 97 && ker.wVirtualKeyCode <= 122) || (ker.wVirtualKeyCode >= 48 && ker.wVirtualKeyCode <= 57) || (ker.wVirtualKeyCode == 32)) PutChar(ker.wVirtualKeyCode); break; } } } break; case MOUSE_EVENT: // mouse input { MOUSE_EVENT_RECORD ker = inpt[i].Event.MouseEvent; if (ker.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED){ if (IsClicked(ker.dwMousePosition)){ SetColors(); SetFocus(&ker.dwMousePosition); } else{ SetFocus(NULL); } } } break; case WINDOW_BUFFER_SIZE_EVENT: // scrn buf. resizing break; case FOCUS_EVENT: // disregard focus events case MENU_EVENT: // disregard menu events break; default: break; } }
void Painter::Init () { if (solid == nil) { solid = new Pattern(0xffff); clear = new Pattern(0); lightgray = new Pattern(0x8020); gray = new Pattern(0xa5a5); darkgray = new Pattern(0xfafa); single = new Brush(0xffff, 0); } foreground = nil; background = nil; pattern = nil; br = nil; font = nil; style = 0; matrix = nil; SetColors(black, white); SetPattern(solid); FillBg(true); SetBrush(single); SetFont(stdfont); SetStyle(Plain); SetOrigin(0, 0); MoveTo(0, 0); }
void PFO_ColorCubeIsovolumeGL::DrawPlotObject() { if (!InitDrawObject()) return; #ifdef _GLPRHARDCOPY_ if (DoingHardCopy()) { int glpNum = vertexCount; glpBegin(GLP_3D_COLOR, glpNum); objectBase->SetHardCopyParameters(); } #endif vertexCount = 0; SetColors(); for (int i = 0; i < triToPlot.Size(); i++) { DoPoly(i); vertexCount += isoCalc.polyCoords.Size(); } GL_Base::HardCopyBlockEnd(); CloseDrawObject(); }
void CEditTile::SetupGroupBurnable(void) { SmartButton *pButton; SmartDialog *pDialog = ADerefAs(SmartDialog, gDialog); uint32 x, y, pri; if(gGroupBurn) { // necessary because Dialog->Activate() will have changed X & Y pButton = ADerefAs(SmartButton, gGroupBurn); x = pButton->scrim.x; y = pButton->scrim.y; pri = pButton->scrim.priority; // if not being run from Setup() ADelete(gGroupBurn); } else { x = 255; y = 75; pri = 100; // doesnt really matter in this case } SetColors(CI_WHITE, CI_BLACK, CI_BLACK); gGroupBurn = pDialog->AddSmartButton(x, y, currGroup.h.burnable? "YES": "no", FALSE, gSelf, SELECTED); gBoxes[BoxCount++] = gGroupBurn; pButton = ADerefAs(SmartButton, gGroupBurn); pButton->SetPri(pri); }
void CglFont::Begin(const bool immediate, const bool resetColors) { if (threadSafety) vaMutex.lock(); if (inBeginEnd) { LOG_L(L_ERROR, "called Begin() multiple times"); if (threadSafety) vaMutex.unlock(); return; } autoOutlineColor = true; setColor = !immediate; if (resetColors) { SetColors(); // reset colors } inBeginEnd = true; va.Initialize(); va2.Initialize(); stripTextColors.clear(); stripOutlineColors.clear(); stripTextColors.push_back(textColor); stripOutlineColors.push_back(outlineColor); glPushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT); glDisable(GL_LIGHTING); glDisable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); }
void avtContourPlot::SetAtts(const AttributeGroup *a) { needsRecalculation = atts.ChangesRequireRecalculation(*(const ContourAttributes*)a); atts = *(const ContourAttributes*)a; if (atts.GetContourMethod() == ContourAttributes::Level) { numLevels = atts.GetContourNLevels(); } else if (atts.GetContourMethod() == ContourAttributes::Value) { numLevels = (int)atts.GetContourValue().size(); } else { numLevels = (int)atts.GetContourPercent().size(); } SetColors(); SetLineWidth(atts.GetLineWidth()); SetLineStyle(atts.GetLineStyle()); SetLegend(atts.GetLegendFlag()); if (atts.GetWireframe()) { behavior->SetAntialiasedRenderOrder(ABSOLUTELY_LAST); levelsMapper->SetSpecularIsInappropriate(true); } else { behavior->SetAntialiasedRenderOrder(DOES_NOT_MATTER); levelsMapper->SetSpecularIsInappropriate(false); } }
//--------------------------------------------------------------------------- long FindColor(short hue, short saturation, short value, float *color_certainties) { double max_membership,membership; int color_index,res; int random1; if (!rules_loaded) { char *ColorFunctionsStart,*RulesStart; SetColors(); ColorFunctionsStart=strstr(rulesfile,"color_functions:"); RulesStart=strstr(rulesfile,"rules:"); if (!LoadColorsFunctions(ColorFunctionsStart) || !LoadRules(RulesStart)) { printf("Could not load rules \n"); return(-1); } rules_loaded=1; } max_membership=0; res=COLOR_LIGHT_GREY; for (color_index=COLOR_WHITE;color_index<=COLOR_LIGHT_FUCIA;color_index++) if (colors[color_index].color>=0) { membership=CalculateRules2(hue,saturation,value,color_index); if (color_certainties) color_certainties[color_index]=membership; if (membership>max_membership) { max_membership=membership; res=color_index; } } // return(num2tcolor(res)); return(res); }
void Button::SetColors(ColorPreset preset, bool alt) { switch (preset) { case C_BLUE: SetColors(RGBA8(0x00, 0xCC, 0xFF, 0xFF), RGBA8(0xAA, 0xEE, 0xFF, 0xFF), alt); break; case C_GREEN: SetColors(RGBA8(0x5C, 0xE5, 0x00, 0xFF), RGBA8(0xB0, 0xFF, 0x7B, 0xFF), alt); break; case C_PINK: SetColors(RGBA8(0xFF, 0x80, 0xFF, 0xFF), RGBA8(0xFF, 0xCC, 0xFF, 0xFF), alt); break; case C_ORANGE: SetColors(RGBA8(0xFF, 0xCC, 0x00, 0xFF), RGBA8(0xFF, 0xEE, 0xAA, 0xFF), alt); break; } }
LRESULT RingStatic::OnBkColor(UINT uMsg,HDC hDC) { switch(uMsg) { case WM_CTLCOLORSTATIC: return SetColors(hDC); } return 0; }
cDialog :: cDialog( double nposx, double nposy, string nidentifier, string ntext, DialogType dialogtype, Uint8 nmax_length /* = 20 */, unsigned int nmin_width ) : cSprite( NULL, nposx, nposy ) { stext = NULL; if( is_valid_number( ntext.c_str() ) ) { text_number = string_to_int( ntext ); } else { text_number = 0; } identifier.reserve( nidentifier.length() ); identifier = nidentifier; text = ntext; type = dialogtype; boarder_in = 2; boarder_out = 2; text_area = 1; min_width = nmin_width; if( type != DIALOG_ONLY_NUMBERS ) { if( nmax_length < ntext.length() ) { max_length = ntext.length(); } else { max_length = nmax_length; } text.reserve( max_length ); } else { if( nmax_length < text_number ) { max_length = text_number; } else { max_length = nmax_length; } text.reserve( 20 ); } SetColors( colorDarkBlue, colorBlue, colorWhite, colorBlack ); Update_Boarders(); Update_Text(); }
void PFO_ColorCubeIsovolumeGL::DrawTransObject(int objIndex) { if (InitDrawObject()) { SetColors(); DoPoly(objIndex); CloseDrawObject(); } }
bool MuteButton::SetOnBySolo(bool p_vOn) { /* if(GetOn() && !m_vOnBySolo) // This is if the track is muted and soloed and then solo button is pressed { ExecuteCommand(); return false; } else if(GetOn() && m_vOnBySolo) // This is if the track is muted and not soloed and then solo button is pressed { ExecuteCommand(); return false; } */ if(m_vOnBySolo == p_vOn) return false; m_vOnBySolo = p_vOn; if(m_vOnBySolo) { SetColors(m_oOnBySoloColor); SetOn(true); ExecuteCommand(); return true; } SetOn(false); SetColors(m_oOnByUserColor); EMMuteState eMuteState; if(GetOn()) { eo << "Setting mute state for track with ID " << m_vMediaTrackID << " to EM_MUTE_ON_BY_SOLO" << ef; eMuteState = EM_MUTE_ON_BY_SOLO; } else { eo << "Setting mute state for track with ID " << m_vMediaTrackID << " to EM_MUTE_OFF" << ef; eMuteState = EM_MUTE_OFF; } EMCommandRepository::Instance() -> ExecuteCommand(MEDIA_COMMAND_SET_TRACK_MUTE_STATE, &m_vMediaTrackID, &eMuteState); // ExecuteCommand(); return false; }
Color_t Colors::GetColor() { Color_t myColor = kBlack; if(m_colors.size() > 0 ) { myColor = m_colors.back(); m_colors.pop_back(); return myColor; } else { SetColors(); return GetColor(); } }
void avtTopologyPlot::CustomizeBehavior(void) { SetColors(); levelsLegend->SetLookupTable(avtLUT->GetLookupTable()); behavior->SetRenderOrder(MUST_GO_LAST); behavior->SetAntialiasedRenderOrder(MUST_GO_LAST); behavior->SetLegend(levLegendRefPtr); behavior->SetShiftFactor(0.5); }
void avtParallelCoordinatesPlot::SetAtts(const AttributeGroup *a) { needsRecalculation = atts.ChangesRequireRecalculation(*(const ParallelCoordinatesAttributes*)a); atts = *(const ParallelCoordinatesAttributes*)a; SetColors(); behavior->SetRenderOrder(DOES_NOT_MATTER); behavior->SetAntialiasedRenderOrder(DOES_NOT_MATTER); }
int main(int argc, char *argv[]) { int w,h; Rect gb; HNN=MakeHashTable(); HEL=MakeHashTable(); HLI=MakeHashTable(); HVC=MakeHashTable(); CM=MakeQueueTable(); SetOptions(argc,argv); ReadFiles(argc,argv); CheckNodes(HNN,HEL,HLI,HVC); if( OpCheck ) CheckMore(HNN,HEL,HLI); InitMinMax(&gb); GetNodeMinMax(HNN,&gb); GetNodeMinMax(HVC,&gb); SetMinMax(&gb); printf("Min/Max values : %f %f %f %f\n", gb.low.x,gb.low.y,gb.high.x,gb.high.y); printf("Center values : %f %f \n", (gb.low.x+gb.high.x)/2.,(gb.low.y+gb.high.y)/2.); GbAll = GbPlo = gb; QGraphInit(); QNewPen(PlotCol); SetColors(OpCol); QWindowMaxXY(&w,&h); ResizeWindow(w,h); ScaleFactor(HVC); MakeGridMenu(); /* MouseInit(); */ QInitEvent(); LoopForInput(); QGraphClose(); WriteFiles(); return 0; }
void Cube3D::AnimateStop(char m, int rot) { TransCount = 0; while(rot) { FaceMap.Rotate(m, rot); rot += (rot < 0) ? 1 : -1; } SetColors(); }
Cube3D::Cube3D() { for(int i = 0; i < 27; ++i) Map[i] = new Cubelet(i); const GLfloat a = 1.0; const GLfloat b = -1.0; Map[ 0]->SetPosition(b, a, a); Map[ 1]->SetPosition(0.0, a, a); Map[ 2]->SetPosition(a, a, a); Map[ 3]->SetPosition(b, 0.0, a); Map[ 4]->SetPosition(0.0, 0.0, a); Map[ 5]->SetPosition(a, 0.0, a); Map[ 6]->SetPosition(b, b, a); Map[ 7]->SetPosition(0.0, b, a); Map[ 8]->SetPosition(a, b, a); Map[ 9]->SetPosition(b, a, 0.0); Map[10]->SetPosition(0.0, a, 0.0); Map[11]->SetPosition(a, a, 0.0); Map[12]->SetPosition(b, 0.0, 0.0); Map[13]->SetPosition(0.0, 0.0, 0.0); Map[14]->SetPosition(a, 0.0, 0.0); Map[15]->SetPosition(b, b, 0.0); Map[16]->SetPosition(0.0, b, 0.0); Map[17]->SetPosition(a, b, 0.0); Map[18]->SetPosition(b, a, b); Map[19]->SetPosition(0.0, a, b); Map[20]->SetPosition(a, a, b); Map[21]->SetPosition(b, 0.0, b); Map[22]->SetPosition(0.0, 0.0, b); Map[23]->SetPosition(a, 0.0, b); Map[24]->SetPosition(b, b, b); Map[25]->SetPosition(0.0, b, b); Map[26]->SetPosition(a, b, b); FaceMap.Reset(); FaceMap.SaveState(); SetColors(); TransCount = 0; angles[0] = 0.0; angles[1] = 10.0; angles[2] = -180.0; }
void CEditTile::SetupLabels(void) { SmartDialog *pDialog = ADerefAs(SmartDialog, gDialog); SetColors(CI_BLACK, CI_WHITE, CI_WHITE); pDialog->AddSmartLabel(240, 30, "Type"); pDialog->AddSmartLabel(10, 45, "Name"); pDialog->AddSmartLabel(190, 45, "Clr"); pDialog->AddSmartLabel(245, 45, "Por"); pDialog->AddSmartLabel(5, 60, "Mov Def Att Rng Dmg"); pDialog->AddSmartLabel(225, 75, "Burn"); SetColors(CI_BLACK, CI_WHITE, CI_WHITE); pDialog->AddSmartLabel(10, 75, "Clust Func"); // pDialog->AddSmartLabel(80, 88, "X Y"); pDialog->AddSmartLabel(15, 101, "Hot X Y"); pDialog->AddSmartLabel(10, 127, " Item Random StartLoc"); pDialog->AddSmartLabel(180, 101, "HP"); pDialog->AddSmartLabel(10, 153, "DestX DestY Owner"); pDialog->AddSmartLabel(60, 30, "Swap Anim Delay"); }
void VertexArray::Add( const unsigned char newcol[], int newcolcount, const float newnorm[], int newnormcount, const float newvert[], int newvertcount, const int newfaces[], int newfacecount, const float newtc[], int newtccount) { assert(texcoords.size() == 1); SetFaces(newfaces, newfacecount, faces.size(), vertices.size() / 3); SetVertices(newvert, newvertcount, vertices.size()); SetNormals(newnorm, newnormcount, normals.size()); SetColors(newcol, newcolcount, colors.size()); SetTexCoords(0, newtc, newtccount, texcoords[0].size()); }
void CEditTile::SetupGroupColor(void) { SmartBox *pBox; SmartDialog *pDialog; // uint32 x, y, pri; //oldFore = pFontMgr->colors[FNT_FORE_COLOR], oldBack = pFontMgr->colors[FNT_BACK_COLOR]; pDialog = ADerefAs(SmartDialog, gDialog); if(currGroup.h.miniColor != CI_BLACK) { SetColors(currGroup.h.miniColor, CI_BLACK, CI_BLACK); } else { SetColors(currGroup.h.miniColor, CI_WHITE, CI_WHITE); } sprintf(szMiniColor, "%d", currGroup.h.miniColor); if(!gMiniColor) { gMiniColor = pDialog->AddSmartBox(210, 45, szMiniColor, 4); gBoxes[BoxCount++] = gMiniColor; pBox = ADerefAs(SmartBox, gMiniColor); pBox->SetupReplies(gSelf, TEXT_CHANGED); // pBox->SetPri(100); } else { pBox = ADerefAs(SmartBox, gMiniColor); pBox->SetCurrentString(szMiniColor); } // pFontMgr->colors[FNT_FORE_COLOR] = oldFore; // pFontMgr->colors[FNT_BACK_COLOR] = oldBack; }
// operator= Gradient& Gradient::operator=(const Gradient& other) { #ifdef ICON_O_MATIC AutoNotificationSuspender _(this); #endif SetTransform(other); SetColors(other); SetType(other.fType); SetInterpolation(other.fInterpolation); SetInheritTransformation(other.fInheritTransformation); return *this; }
bool avtParallelCoordinatesPlot::SetBackgroundColor(const double *bg) { if (bgColor[0] == bg[0] && bgColor[1] == bg[1] && bgColor[2] == bg[2]) { return false; } bgColor[0] = bg[0]; bgColor[1] = bg[1]; bgColor[2] = bg[2]; SetColors(); return true; }
int TAP_Main(void) { int err1; InitTAPAPIFix(); transparency_orig = TAP_GetSystemVar( SYSVAR_OsdAlpha ); rgn = TAP_Osd_Create(0, 0, 720, 576, 0, 0); TAP_Osd_SetTransparency( rgn, 150 ); err1 = Load_Font(&font0, "calibri_small.rasterized"); if (err1!=0) return 0; err1 = Load_Font(&font1, "arialn_small.rasterized"); if (err1!=0) return 0; err1 = Load_Font(&font2, "tahoma_small.rasterized"); if (err1!=0) return 0; SetColors(&font0, COLOR_Red, COLOR_White); SetColors(&font1, COLOR_Red, COLOR_White); SetColors(&font2, COLOR_Red, COLOR_White); return 1; }
CBCGPKnob::CBCGPKnob(CBCGPVisualContainer* pContainer) : CBCGPCircularGaugeImpl(pContainer) { m_bCacheImage = FALSE; m_bIsInteractiveMode = TRUE; m_nFrameSize = 2; m_bDrawTextBeforeTicks = TRUE; m_bDrawTicksOutsideFrame = TRUE; m_CapSize = 0.; SetColors(CBCGPCircularGaugeColors::BCGP_CIRCULAR_GAUGE_SILVER); SetInteractiveMode(); SetPointer(CBCGPKnobPointer(), FALSE); }