/* -------------------------------------------------------------------- */ static void plotDiffLines(PLOT_INFO *plot) { if (Color) { ResetColors(); XSetForeground(plot->dpy, plot->gc, NextColor()); } XSetLineAttributes(plot->dpy, plot->gc, LineThickness, LineSolid, CapButt, JoinMiter); plotTimeSeries(plot, &diffSet); if (Color) XSetForeground(plot->dpy, plot->gc, GetColor(0)); sprintf(buffer, "%10.2f%10.2f%10.2f%10.2f%10.2f", diffSet.stats.mean, diffSet.stats.sigma, diffSet.stats.variance, diffSet.stats.min, diffSet.stats.max); XDrawString(plot->dpy, plot->win, plot->gc, plot->x.xLegendText+100, yLegendX(plot, 0)+3, buffer, strlen(buffer)); strcpy(buffer, " mean sigma var min max"); XDrawString(plot->dpy, plot->win, plot->gc, plot->x.xLegendText+100, yLegendX(plot, 2)+12, buffer, strlen(buffer)); } /* END PLOTDIFFLINES */
Slider::Slider(RenderWindow* parent, std::string name, float x, float y, float w, float h): Control(parent, name), value(0.0), sliderHeight(0.2) { SetPosition(x, y); SetSize(w, h); ResetColors(); }
/**Button class**/ Button::Button(RenderWindow* destWindow, std::string name): Control(destWindow, name), border(false), active({{0, 0, 0, 255}, {255, 255, 255, 255}}), push({{255, 255, 255, 255}, {0, 0, 0, 255}}), caption("Button"), fontSize(14), font(NULL), captionTexture{NULL, NULL} { ResetColors(); }
//////////////////////////////////////////////////////////////////////////////// // Resets the entire skin void MAS::Skin::Reset() { Unload(); ResetColors(); ResetControls(); GenerateDefaultFonts(); GenerateDefaultCursors(); GenerateDefaultSamples(); GenerateDefaultBitmaps(); }
Button::Button(RenderWindow* destWindow, std::string name, float x, float y, float w, float h): Control(destWindow, name), border(false), active({{0, 0, 0, 255}, {255, 255, 255, 255}}), push({{255, 255, 255, 255}, {0, 0, 0, 255}}), caption("Button"), fontSize(14), font(NULL), captionTexture{NULL, NULL} { SetSize(w, h); SetPosition(x, y); ResetColors(); }
CSkin::CSkin() { m_hbmpBkgnd = NULL; int i; for (i = 0; i <= IMAGELIST_MAX; i++) { m_himlImageLists[i] = NULL; } ResetColors(); }
FReply FPathContextMenu::ExecuteDeleteFolderConfirmed() { if ( ContentBrowserUtils::DeleteFolders(SelectedPaths) ) { ResetColors(); if (OnFolderDeleted.IsBound()) { OnFolderDeleted.Execute(); } } return FReply::Handled(); }
CNSChartCtrl::~CNSChartCtrl() { m_txtFont.DeleteObject(); m_boldFont.DeleteObject(); ResetChart(); ResetColors(); if(m_bmpScreen.m_hObject != NULL) { m_bmpScreen.DeleteObject(); m_bmpScreen.m_hObject = NULL; } }
void CSkin::Unload() { if (m_hbmpBkgnd) { DeleteObject(m_hbmpBkgnd); m_hbmpBkgnd = NULL; } int i; for (i = 0; i <= IMAGELIST_MAX; i++) { if (m_himlImageLists[i]) { ImageList_Destroy(m_himlImageLists[i]); m_himlImageLists[i] = NULL; } } ResetColors(); }
void Terrain::NextMap( void ) { assert(m_maps.size() && "No maps loaded"); m_nextMap = ++m_nextMap % m_maps.size(); Map& map = m_maps[m_nextMap]; m_width = map.GetWidth(); m_terrain = map.GetTerrain(); m_terrainColor = map.GetTerrainColor(); m_terrainInfluenceMap = map.GetInfluenceMap(); ResetColors(); ResetInfluenceMap(); Analyze(); g_database.SendMsgFromSystem(MSG_MapChange); }
static void postSpawn( long rc ) { restorePrompt(); VarAddGlobalLong( "Sysrc", rc ); UpdateCurrentDirectory(); #ifndef __WIN__ ResetColors(); // if( (EditFlags.PauseOnSpawnErr && rc != 0 ) || // !EditFlags.SourceScriptActive ) { if( EditFlags.PauseOnSpawnErr && rc != 0 ) { MyPrintf( "[%s]\n", MSG_PRESSANYKEY ); GetNextEvent( false ); } ResetSpawnScreen(); if( !EditFlags.LineDisplay ) { ReDisplayScreen(); } #endif EditFlags.ClockActive = clockActive; }
//---------------------------------------------------------------------------- void CollisionsBoundTree::CreateScene () { // The root of the scene will have two cylinders as children. mScene = new0 Node(); mWireState = new0 WireState(); mRenderer->SetOverrideWireState(mWireState); mCullState = new0 CullState(); mCullState->Enabled = false; mRenderer->SetOverrideCullState(mCullState); // Create a texture image to be used by both cylinders. Texture2D* texture = new0 Texture2D(Texture::TF_A8R8G8B8, 2, 2, 1); unsigned int* data = (unsigned int*)texture->GetData(0); data[0] = Color::MakeR8G8B8(0, 0, 255); // blue data[1] = Color::MakeR8G8B8(0, 255, 255); // cyan data[2] = Color::MakeR8G8B8(255, 0, 0); // red data[3] = Color::MakeR8G8B8(255, 255, 0); // yellow Texture2DEffect* effect = new0 Texture2DEffect(Shader::SF_LINEAR); // Create two cylinders, one short and thick, one tall and thin. VertexFormat* vformat = VertexFormat::Create(2, VertexFormat::AU_POSITION, VertexFormat::AT_FLOAT3, 0, VertexFormat::AU_TEXCOORD, VertexFormat::AT_FLOAT2, 0); StandardMesh sm(vformat); VertexBufferAccessor vba; int i; mCylinder0 = sm.Cylinder(8, 16, 1.0f, 2.0f, false); vba.ApplyTo(mCylinder0); for (i = 0; i < vba.GetNumVertices(); ++i) { vba.TCoord<Float2>(0, i) = mBlueUV; } mCylinder0->SetEffectInstance(effect->CreateInstance(texture)); mScene->AttachChild(mCylinder0); mCylinder1 = sm.Cylinder(16,8,0.25,4.0,false); vba.ApplyTo(mCylinder1); for (i = 0; i < vba.GetNumVertices(); ++i) { vba.TCoord<Float2>(0, i) = mRedUV; } mCylinder1->SetEffectInstance(effect->CreateInstance(texture)); mScene->AttachChild(mCylinder1); mScene->Update(); // Set up the collision system. Record0 handles the collision response. // Record1 is not given a callback so that 'double processing' of the // events does not occur. CTree* tree0 = new0 CTree(mCylinder0, 1, false); CRecord* record0 = new0 CRecord(tree0, 0, Response, this); CTree* tree1 = new0 CTree(mCylinder1, 1, false); CRecord* record1 = new0 CRecord(tree1, 0, 0, 0); mGroup = new0 CGroup(); mGroup->Add(record0); mGroup->Add(record1); ResetColors(); mGroup->TestIntersection(); }
Slider::Slider(RenderWindow* parent, std::string name): Control(parent, name), value(0.0), sliderHeight(0.2) { ResetColors(); }
void FPathContextMenu::ExecuteResetColor() { ResetColors(); }
void CNSChartCtrl::PrepareColors(DefaultColors defaultColor) { switch(defaultColor){ case EMPY: ResetColors(); break; case GrayScale: ResetColors(); AddSolidBrush(0x00666666); AddSolidBrush(0x00DDDDDD); AddSolidBrush(0x00888888); AddSolidBrush(0x00444444); AddSolidBrush(0x00CCCCCC); AddSolidBrush(0x00AAAAAA); AddSolidBrush(0x00000000); break; case SimpleColors: ResetColors(); AddSolidBrush(0x0000CC00); AddSolidBrush(0x0000FFFF); AddSolidBrush(0x000000FF); AddSolidBrush(0x00FF0000); AddSolidBrush(0x00FF00FF); AddSolidBrush(0x00FFFF00); AddSolidBrush(0x000000CC); AddSolidBrush(0x0000FF00); AddSolidBrush(0x00FFFFCC); AddSolidBrush(0x00CC00CC); AddSolidBrush(0x00CCFF00); AddSolidBrush(0x00CCFFFF); AddSolidBrush(0x00CC000F); AddSolidBrush(0x0000CCCC); AddSolidBrush(0x00C0F0F0); AddSolidBrush(0x00CCCC00); AddSolidBrush(0x0000CC00); AddSolidBrush(0x0000FFFF); AddSolidBrush(0x000000FF); AddSolidBrush(0x00FF0000); AddSolidBrush(0x00FF00FF); AddSolidBrush(0x00FFFF00); AddSolidBrush(0x000000CC); AddSolidBrush(0x0000FF00); AddSolidBrush(0x00FFFFCC); AddSolidBrush(0x00CC00CC); AddSolidBrush(0x00CCFF00); AddSolidBrush(0x00CCFFFF); AddSolidBrush(0x00CC000F); AddSolidBrush(0x0000CCCC); AddSolidBrush(0x00C0F0F0); AddSolidBrush(0x00CCCC00); AddSolidBrush(0x00CCCC00); AddSolidBrush(0x0000CC00); AddSolidBrush(0x0000FFFF); AddSolidBrush(0x000000FF); AddSolidBrush(0x00FF0000); AddSolidBrush(0x00FF00FF); AddSolidBrush(0x00FFFF00); AddSolidBrush(0x000000CC); AddSolidBrush(0x0000FF00); AddSolidBrush(0x00FFFFCC); AddSolidBrush(0x00CC00CC); AddSolidBrush(0x00CCFF00); AddSolidBrush(0x00CCFFFF); AddSolidBrush(0x00CC000F); AddSolidBrush(0x0000CCCC); AddSolidBrush(0x00C0F0F0); AddSolidBrush(0x00CCCC00); break; }; }
void FCollectionContextMenu::ExecuteResetColor() { ResetColors(); }
void QmitkStdMultiWidgetEditorPreferencePage::CreateQtControl(QWidget* parent) { berry::IPreferencesService::Pointer prefService = berry::Platform::GetServiceRegistry() .GetServiceById<berry::IPreferencesService>(berry::IPreferencesService::ID); m_StdMultiWidgetEditorPreferencesNode = prefService->GetSystemPreferences()->Node(QmitkStdMultiWidgetEditor::EDITOR_ID); m_MainControl = new QWidget(parent); m_EnableFlexibleZooming = new QCheckBox; m_ShowLevelWindowWidget = new QCheckBox; m_PACSLikeMouseMode = new QCheckBox; QFormLayout *formLayout = new QFormLayout; formLayout->addRow("&Use constrained zooming and padding", m_EnableFlexibleZooming); formLayout->addRow("&Show level/window widget", m_ShowLevelWindowWidget); formLayout->addRow("&PACS like mouse interactions (select left mouse button action)", m_PACSLikeMouseMode); // gradient background QLabel* gBName = new QLabel; gBName->setText("Gradient background"); formLayout->addRow(gBName); // color m_ColorButton1 = new QPushButton; m_ColorButton1->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); m_ColorButton2 = new QPushButton; m_ColorButton2->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); QPushButton* resetButton = new QPushButton; resetButton->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); resetButton->setText("Reset"); QLabel* colorLabel1 = new QLabel("first color : "); colorLabel1->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); QLabel* colorLabel2 = new QLabel("second color: "); colorLabel2->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); QHBoxLayout* colorWidgetLayout = new QHBoxLayout; colorWidgetLayout->setContentsMargins(4,4,4,4); colorWidgetLayout->addWidget(colorLabel1); colorWidgetLayout->addWidget(m_ColorButton1); colorWidgetLayout->addWidget(colorLabel2); colorWidgetLayout->addWidget(m_ColorButton2); colorWidgetLayout->addWidget(resetButton); QWidget* colorWidget = new QWidget; colorWidget->setLayout(colorWidgetLayout); //spacer QSpacerItem *spacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); QVBoxLayout* vBoxLayout = new QVBoxLayout; vBoxLayout->addLayout(formLayout); vBoxLayout->addWidget(colorWidget); vBoxLayout->addSpacerItem(spacer); m_MainControl->setLayout(vBoxLayout); QObject::connect( m_ColorButton1, SIGNAL( clicked() ) , this, SLOT( FirstColorChanged() ) ); QObject::connect( m_ColorButton2, SIGNAL( clicked() ) , this, SLOT( SecondColorChanged() ) ); QObject::connect( resetButton, SIGNAL( clicked() ) , this, SLOT( ResetColors() ) ); this->Update(); }
//---------------------------------------------------------------------------- bool CollisionsBoundTree::Transform (unsigned char key) { // Move the tall/thin cylinder. After each motion, reset the texture // coordinates to the "no intersection" state, then let the collision // system test for intersection. Any intersecting triangles have their // texture coordinates changed to the "intersection" state. float trnSpeed = 0.1f; float rotSpeed = 0.1f; HMatrix rot, incr; APoint trn; switch (key) { case 'x': trn = mCylinder1->LocalTransform.GetTranslate(); trn[0] -= trnSpeed; mCylinder1->LocalTransform.SetTranslate(trn); break; case 'X': trn = mCylinder1->LocalTransform.GetTranslate(); trn[0] += trnSpeed; mCylinder1->LocalTransform.SetTranslate(trn); break; case 'y': trn = mCylinder1->LocalTransform.GetTranslate(); trn[1] -= trnSpeed; mCylinder1->LocalTransform.SetTranslate(trn); break; case 'Y': trn = mCylinder1->LocalTransform.GetTranslate(); trn[1] += trnSpeed; mCylinder1->LocalTransform.SetTranslate(trn); break; case 'z': trn = mCylinder1->LocalTransform.GetTranslate(); trn[2] -= trnSpeed; mCylinder1->LocalTransform.SetTranslate(trn); break; case 'Z': trn = mCylinder1->LocalTransform.GetTranslate(); trn[2] += trnSpeed; mCylinder1->LocalTransform.SetTranslate(trn); break; case 'r': rot = mCylinder1->LocalTransform.GetRotate(); incr.MakeRotation(AVector::UNIT_X, rotSpeed); mCylinder1->LocalTransform.SetRotate(incr*rot); break; case 'R': rot = mCylinder1->LocalTransform.GetRotate(); incr.MakeRotation(AVector::UNIT_X, -rotSpeed); mCylinder1->LocalTransform.SetRotate(incr*rot); break; case 'a': rot = mCylinder1->LocalTransform.GetRotate(); incr.MakeRotation(AVector::UNIT_Y, rotSpeed); mCylinder1->LocalTransform.SetRotate(incr*rot); break; case 'A': rot = mCylinder1->LocalTransform.GetRotate(); incr.MakeRotation(AVector::UNIT_Y, -rotSpeed); mCylinder1->LocalTransform.SetRotate(incr*rot); break; case 'p': rot = mCylinder1->LocalTransform.GetRotate(); incr.MakeRotation(AVector::UNIT_Z, rotSpeed); mCylinder1->LocalTransform.SetRotate(incr*rot); break; case 'P': rot = mCylinder1->LocalTransform.GetRotate(); incr.MakeRotation(AVector::UNIT_Z, -rotSpeed); mCylinder1->LocalTransform.SetRotate(incr*rot); break; default: return false; } // Activate the collision system. mCylinder1->Update(); ResetColors(); mGroup->TestIntersection(); return true; }