void MainWindow::ConnectSignals() { // Hauptfarbe connect(ui->ColorPickerFront, SIGNAL(activated()), ui->ColorPickerBack, SLOT(background())); connect(ui->ColorPickerFront, SIGNAL(colorChanged(QColor)), this, SLOT(ColorChanged(QColor))); // Sekundärfarbe connect(ui->ColorPickerBack, SIGNAL(activated()), ui->ColorPickerFront, SLOT(background())); connect(ui->ColorPickerBack, SIGNAL(colorChanged(QColor)), this, SLOT(ColorChanged(QColor))); // Werkzeuggröße connect(mSizeDialog, SIGNAL(sizeChanged(int)), this, SLOT(SizeChanged(int))); // Befehl hat sich geändert connect(this, SIGNAL(Operation(IOperation*,QHash<QString,QString>,OperationType)), this, SLOT(Operation(IOperation*,QHash<QString,QString>,OperationType))); }
void CDestination::ReadChunk( CIFFReader &reader) { ASSERT(IsWriteLocked()); switch (reader.ChunkID()) { case DESTINATION_HEADER_CHUNK: { reader >> m_id; reader >> m_latency; reader >> m_flags; reader >> m_color; ColorChanged(m_color); break; } case DESTINATION_NAME_CHUNK: { reader.MustRead(m_name, MIN((size_t)reader.ChunkLength(), DESTINATION_NAME_LENGTH)); NameChanged(m_name); break; } default: { CSerializable::ReadChunk(reader); } } }
void IconDes::RightDown(Point p, dword flags) { p = GetPos(p); if(!InImage(p)) return; if(tool == &IconDes::HotSpotTool) { if(p != Current().image.Get2ndSpot()) { ImageBuffer ib(Current().image); ib.Set2ndSpot(p); Current().image = ib; Refresh(); } return; } RGBA ic = CurrentImage()[p.y][p.x]; RGBA c = CurrentColor(); if(flags & K_ALT) { c.a = ic.a; ic = c; } if(flags & K_CTRL) ic.a = c.a; rgbactrl.Set(ic); ColorChanged(); }
//------------------------------------------------------------------------------------------- //! //------------------------------------------------------------------------------------------- tPageBase::tPageBase( const Page::ePageId id, const QString& title, tIInstrumentProductFactory* pProductFactory, tInstrumentState* pAppState , QWidget* pParent ) : QWidget( pParent ) ,m_Id( id ) ,m_Title( title ) ,m_pProductFactory( pProductFactory ) ,m_pAppState( pAppState ) { Assert( m_pProductFactory ); setAutoFillBackground( true ); m_InstanceCount++; m_pMainLayout = new QGridLayout( this ); m_pMainLayout->setContentsMargins( 0, 0, 0, 0 ); m_pMainLayout->setSpacing( 0 ); m_pTitleLabel = new QLabel( m_Title, this ); m_pTitleLabel->hide(); m_pMainLayout->addWidget( m_pTitleLabel, 0, 0, Qt::AlignCenter ); setLayout( m_pMainLayout ); CreateCommonActions(); Connect( tInstrumentUiSettings::Instance(), SIGNAL( ColorChanged() ), this, SLOT( UpdateColors() ) ); Connect( tSystemSettings::Instance(), SIGNAL( NightModeChanged(bool,bool) ), this, SLOT( UpdateColors() ) ); Connect( tUiSettings::Instance(), SIGNAL( NightModeTextColorChanged( eNightModeTextColor ) ), this, SLOT( UpdateColors() ) ); UpdateColors(); }
void TextComponent::SetColor(Ogre::ColourValue color) { mColor = color; if(mLabel != nullptr) { mLabel->setColour(mColor); } emit ColorChanged(); }
void nuiColorSelector::SetCurrentColor(const nuiColor& rColor) { mCurrentColor = rColor; mpColorPaneDeco->SetFillColor(rColor); nuiSize red = rColor.Red(); nuiSize green = rColor.Green(); nuiSize blue = rColor.Blue(); nuiSize alpha = rColor.Alpha(); FormatColor(red, mpRedSliderLabel); FormatColor(green, mpGreenSliderLabel); FormatColor(blue, mpBlueSliderLabel); FormatColor(alpha, mpRGBAlphaSliderLabel); float h, s, v; h = mpHueSlider->GetRange().GetValue(); s = mpSaturationSlider->GetRange().GetValue(); v = mpValueSlider->GetRange().GetValue(); FormatColor(h, mpHueSliderLabel, 100, false); FormatColor(s, mpSaturationSliderLabel, 100, false); FormatColor(v, mpValueSliderLabel, 100, false); FormatColor(alpha, mpHSVAlphaSliderLabel, 100, false); mpColorPane->Invalidate(); uint tabIndex = mpTabView->GetSelectedTab(); if (tabIndex != 0) Tab_RGB_Update(); if (tabIndex != 1) Tab_HSV_Update(); // send event ColorChanged(); }
void ImageWidget::mousePressEvent(QMouseEvent *event) { QWidget::mousePressEvent(event); // Eventlogik if (event->button() == Qt::LeftButton) { // Speicher Position QPoint pos = event->pos(); mArgs["PreviousX"] = QString::number(pos.x()); mArgs["PreviousY"] = QString::number(pos.y()); mArgs["X"] = QString::number(pos.x()); mArgs["Y"] = QString::number(pos.y()); // Speicher altes Bild mUndoBuffer.push(mImage.copy()); mChanged = true; // Erlaube Zeichnen mDraw = true; // Aktualisiere Bild update(); if (mTrack) { emit ColorChanged(GetPixel()); } } }
void ImageWidget::mouseReleaseEvent(QMouseEvent *event) { QWidget::mouseReleaseEvent(event); // Eventlogik if (event->button() == Qt::LeftButton) { mDraw = false; // Aktualisiere Bild update(); if (mTrack) { emit ColorChanged(GetPixel()); } } }
void JXColorWheel::Receive ( JBroadcaster* sender, const Message& message ) { if (sender == itsBrightnessSlider && message.Is(JSliderBase::kMoved)) { itsColor.brightness = JRound(itsBrightnessSlider->GetValue()); Broadcast(ColorChanged()); Refresh(); } else { JXWidget::Receive(sender, message); } }
void JXColorWheel::SetColor ( const JHSB& hsb ) { if (itsColor != hsb) { itsColor = hsb; StopListening(itsBrightnessSlider); itsBrightnessSlider->SetValue(itsColor.brightness); ListenTo(itsBrightnessSlider); Broadcast(ColorChanged()); Refresh(); } }
void CColorSlider::KeyDown(const char *bytes, int32 numBytes) { BRect r(Bounds()); r.InsetBy(1, 1); float a, nv = fValue; if (fHorizontal) a = r.Width() - r.Height(); else a = r.Height() - r.Width(); switch (bytes[0]) { case B_UP_ARROW: if (!fHorizontal) nv = std::min(1.0F, (fValue * a + 1) / a); break; case B_LEFT_ARROW: if (fHorizontal) nv = std::max(0.0F, (fValue * a - 1) / a); break; case B_DOWN_ARROW: if (!fHorizontal) nv = std::max(0.0F, (fValue * a - 1) / a); break; case B_RIGHT_ARROW: if (fHorizontal) nv = std::min(1.0F, (fValue * a + 1) / a); break; default: BView::KeyDown(bytes, numBytes); } if (nv != fValue) { fValue = nv; ColorChanged() ; } } /* CColorSlider::KeyDown */
void ImageWidget::mouseMoveEvent(QMouseEvent *event) { QWidget::mouseMoveEvent(event); // Eventlogik if (mDraw && mOperation) { // Speicher Position QPoint pos = event->pos(); mArgs["PreviousX"] = mArgs["X"]; mArgs["PreviousY"] = mArgs["Y"]; mArgs["X"] = QString::number(pos.x()); mArgs["Y"] = QString::number(pos.y()); // Aktualisiere Bild update(); if (mTrack) { emit ColorChanged(GetPixel()); } } }
void CDestination::SetColor( rgb_color color) { D_ACCESS(("CDestination::SetColor(%d, %d, %d, %d)\n", color.red, color.green, color.blue, color.alpha)); ASSERT(IsWriteLocked()); if ((color.red != m_color.red) || (color.green != m_color.green) || (color.blue != m_color.blue)) { m_color = color; ColorChanged(color); Document()->SetModified(); CUpdateHint hint; hint.AddInt32("DestID", m_id); hint.AddInt32("DestAttrs", Update_Color); PostUpdate(&hint); } }
_OpacityWidgetLayout->addWidget(_OpacityLabel); _OpacityWidgetLayout->addWidget(m_OpacitySlider); QWidget* _OpacityWidget = new QWidget; _OpacityWidget->setLayout(_OpacityWidgetLayout); m_OpacityAction = new QWidgetAction(this); m_OpacityAction->setDefaultWidget(_OpacityWidget); QObject::connect( m_OpacityAction, SIGNAL( changed() ) , this, SLOT( OpacityActionChanged() ) ); unknownDataNodeDescriptor->AddAction(m_OpacityAction, false); m_ColorButton = new QPushButton; m_ColorButton->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); //m_ColorButton->setText("Change color"); QObject::connect( m_ColorButton, SIGNAL( clicked() ) , this, SLOT( ColorChanged() ) ); QLabel* _ColorLabel = new QLabel("Color: "); _ColorLabel->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); QHBoxLayout* _ColorWidgetLayout = new QHBoxLayout; _ColorWidgetLayout->setContentsMargins(4,4,4,4); _ColorWidgetLayout->addWidget(_ColorLabel); _ColorWidgetLayout->addWidget(m_ColorButton); QWidget* _ColorWidget = new QWidget; _ColorWidget->setLayout(_ColorWidgetLayout); m_ColorAction = new QWidgetAction(this); m_ColorAction->setDefaultWidget(_ColorWidget); QObject::connect( m_ColorAction, SIGNAL( changed() ) , this, SLOT( ColorActionChanged() ) ); unknownDataNodeDescriptor->AddAction(m_ColorAction, false);
void SurfaceROI::SetColor( const QColor& color ) { m_color = color; m_actorOutline->GetProperty()->SetColor( color.redF(), color.greenF(), color.blueF() ); emit ColorChanged( color ); }
// Hook called after init static int MainInit(WPARAM wparam,LPARAM lparam) { if ( mir_skins_getInterface(&mski) != 0 ) { MessageBox(NULL, _T("MyDetails needs Skins plugin in order to work"), _T("MyDetails"), MB_OK | MB_ICONERROR); return 0; } if (CallService(MS_SKIN2_GETICON, 0, (LPARAM) "LISTENING_TO_ICON") == NULL) { SKINICONDESC sid = {0}; sid.cbSize = sizeof(SKINICONDESC); sid.ptszSection = "Contact List"; sid.ptszDescription = "Listening to"; sid.pszName = "LISTENING_TO_ICON"; sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LISTENINGTO)); CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); } { SKINICONDESC sid = {0}; sid.cbSize = sizeof(SKINICONDESC); sid.ptszSection = "My Details"; sid.ptszDescription = "Email"; sid.pszName = "MYDETAILS_EMAIL"; sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_EMAIL)); CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); } { SKINICONDESC sid = {0}; sid.cbSize = sizeof(SKINICONDESC); sid.ptszSection = "My Details"; sid.ptszDescription = "Previous protocol"; sid.pszName = "MYDETAILS_PREV_PROTOCOL"; sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LEFT_ARROW)); CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); } { SKINICONDESC sid = {0}; sid.cbSize = sizeof(SKINICONDESC); sid.ptszSection = "My Details"; sid.ptszDescription = "Next protocol"; sid.pszName = "MYDETAILS_NEXT_PROTOCOL"; sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RIGHT_ARROW)); CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); } { ColourID cid = {0}; cid.cbSize = sizeof(ColourID); lstrcpynA(cid.group, "My Details", sizeof(cid.group)); lstrcpynA(cid.name, "Background", sizeof(cid.name)); lstrcpynA(cid.dbSettingsGroup, MODULE_NAME, sizeof(cid.dbSettingsGroup)); lstrcpynA(cid.setting, "BackgroundColor", sizeof(cid.setting)); cid.defcolour = GetSysColor(COLOR_BTNFACE); CallService(MS_COLOUR_REGISTER, (WPARAM) &cid, 0); ColorChanged(0,0); hColorChangedHook = HookEvent(ME_COLOUR_RELOAD, ColorChanged); } dialog = new SkinDialog("MyDetails", "My Details", MODULE_NAME); if (!dialog->isValid()) { MessageBox(NULL, _T("MyDetails could not create dialog. Check if default skin is installed"), _T("MyDetails"), MB_OK | MB_ICONERROR); return 0; } dialog->addImageField("avatar", "Avatar"); dialog->addTextField("nickname", "Nickname"); dialog->addTextField("protocol", "Protocol"); dialog->addIconField("email_icon", "Unread Email Count Icon"); dialog->addTextField("email", "Unread Email Count"); dialog->addIconField("status_icon", "Status Icon"); dialog->addTextField("status_name", "Status"); dialog->addTextField("status_msg", "Status Message"); dialog->addIconField("listening_icon", "Listening To Icon"); dialog->addTextField("listening", "Listening To"); dialog->addIconField("next_proto", "Next Protocol"); dialog->addIconField("prev_proto", "Previous Protocol"); dialog->setSkinChangedCallback(SkinChanged, NULL); dialog->finishedConfiguring(); InitProtocolData(); // Add options to menu CLISTMENUITEM mi; if (protocols->CanSetAvatars()) { ZeroMemory(&mi,sizeof(mi)); mi.cbSize = sizeof(mi); mi.flags = 0; mi.popupPosition = 500050000; mi.pszPopupName = Translate("My Details"); mi.position = 100001; mi.pszName = Translate("Set My Avatar..."); CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYAVATARUI, Menu_SetMyAvatarUI); mi.pszService = "MENU_" MS_MYDETAILS_SETMYAVATARUI; CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); } ZeroMemory(&mi,sizeof(mi)); mi.cbSize = sizeof(mi); mi.flags = 0; mi.popupPosition = 500050000; mi.pszPopupName = Translate("My Details"); mi.position = 100002; mi.pszName = Translate("Set My Nickname..."); CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYNICKNAMEUI, Menu_SetMyNicknameUI); mi.pszService = "MENU_" MS_MYDETAILS_SETMYNICKNAMEUI; CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); ZeroMemory(&mi,sizeof(mi)); mi.cbSize = sizeof(mi); mi.flags = 0; mi.popupPosition = 500050000; mi.pszPopupName = Translate("My Details"); mi.position = 100003; mi.pszName = Translate("Set My Status Message..."); CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYSTATUSMESSAGEUI, Menu_SetMyStatusMessageUI); mi.pszService = "MENU_" MS_MYDETAILS_SETMYSTATUSMESSAGEUI; CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); // Set protocols to show frame ZeroMemory(&mi,sizeof(mi)); mi.cbSize = sizeof(mi); mi.flags = 0; mi.popupPosition = 500050000; mi.pszPopupName = Translate("My Details"); mi.position = 200001; mi.pszName = Translate("Show next protocol"); mi.pszService = MS_MYDETAILS_SHOWNEXTPROTOCOL; CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); InitFrames(); // updater plugin support if(ServiceExists(MS_UPDATE_REGISTER)) { Update upd = {0}; char szCurrentVersion[30]; upd.cbSize = sizeof(upd); upd.szComponentName = pluginInfo.shortName; upd.szUpdateURL = UPDATER_AUTOREGISTER; upd.szBetaVersionURL = "http://svn.berlios.de/svnroot/repos/mgoodies/trunk/mydetails/Docs/mydetails_version.txt"; upd.szBetaChangelogURL = "http://svn.berlios.de/svnroot/repos/mgoodies/trunk/mydetails/Docs/mydetails_changelog.txt"; upd.pbBetaVersionPrefix = (BYTE *)"My Details "; upd.cpbBetaVersionPrefix = strlen((char *)upd.pbBetaVersionPrefix); upd.szBetaUpdateURL = "http://pescuma.googlecode.com/files/mydetails.%VERSION%.zip"; upd.pbVersion = (BYTE *)CreateVersionStringPlugin((PLUGININFO*) &pluginInfo, szCurrentVersion); upd.cpbVersion = strlen((char *)upd.pbVersion); CallService(MS_UPDATE_REGISTER, 0, (LPARAM)&upd); } return 0; }
void CColorSlider::MouseDown(BPoint where) { if (!IsFocus()) MakeFocus(true); BRect b(Bounds()), knob; b.InsetBy(1, 1); float a, s; knob = b; if (fHorizontal) { knob.right = b.left + b.Height(); a = b.Width() - knob.Width(); knob.OffsetBy(fValue * a, 0); s = where.x - knob.left; } else { knob.bottom = b.top + b.Width(); a = b.Height() - knob.Height(); knob.OffsetBy(0, (1 - fValue) * a); s = where.y - knob.top; } if (knob.Contains(where)) { BPoint oldPt(-1, -1); ulong btns; BMessage msg(msg_SliderChanged); msg.AddFloat("value", fValue); msg.AddPointer("sender", this); do { if (oldPt != where) { if (fHorizontal) fValue = std::min(1.0F, std::max(0.0F, (where.x - s) / a)); else fValue = 1 - std::min(1.0F, std::max(0.0F, (where.y - s) / a)); msg.ReplaceFloat("value", fValue); Draw(Bounds()); MessageReceived(&msg); oldPt = where; } GetMouse(&where, &btns); } while (btns); Window()->PostMessage(msg_EndTracking); } else // TPV 00-02-27 { float pos , range ; if (fHorizontal) { pos = where.x - knob.Width()/2; range = a ; } else { pos = a - ( where.y - knob.Width()/2 ) ; range = a ; } if( pos < 0 ) pos = 0 ; else if( pos > range ) pos = range ; fValue = pos/range ; ColorChanged() ; } } /* CColorSlider::MouseDown */