コード例 #1
0
void SyntaxHighlightDlg::OnColourChanged(wxColourPickerEvent& event)
{
    CHECK_PTR_RET(m_lexer);
    m_isModified = true;
    // update colour
    wxObject* obj = event.GetEventObject();
    if(obj == m_colourPicker) {
        wxColour colour = event.GetColour();
        std::list<StyleProperty>::iterator iter = GetSelectedStyle();
        iter->SetFgColour(colour.GetAsString(wxC2S_HTML_SYNTAX));

    } else if(obj == m_bgColourPicker) {

        wxColour colour = event.GetColour();
        std::list<StyleProperty>::iterator iter = GetSelectedStyle();

        iter->SetBgColour(colour.GetAsString(wxC2S_HTML_SYNTAX));

    } else if(obj == m_globalBgColourPicker) {

        wxColour colour = event.GetColour();
        StyleProperty::List_t& properties = m_lexer->GetLexerProperties();
        StyleProperty::List_t::iterator iter = properties.begin();
        for(; iter != properties.end(); ++iter) {
            // Dont change the text selection using the global font picker
            if(iter->GetName() == wxT("Text Selection")) continue;
            iter->SetBgColour(colour.GetAsString(wxC2S_HTML_SYNTAX));
        }

        // update the style background colour as well
        m_bgColourPicker->SetColour(colour);
    }
}
コード例 #2
0
ファイル: GmatColorPanel.cpp プロジェクト: rockstorm101/GMAT
//------------------------------------------------------------------------------
// void OnColorPickerChange(wxColourPickerEvent& event)
//------------------------------------------------------------------------------
void GmatColorPanel::OnColorPickerChange(wxColourPickerEvent& event)
{
   #ifdef DEBUG_COLOR_CHANGE
   MessageInterface::ShowMessage("GmatColorPanel::OnColorPickerChange() entered\n");
   #endif
   
   if (event.GetEventObject() == mOrbitColorCtrl)
   {
      wxColour wxcolor = mOrbitColorCtrl->GetColour();
      RgbColor rgbColor = RgbColor(wxcolor.Red(), wxcolor.Green(), wxcolor.Blue());
      if (mUseInputObjectColor)
      {
         mOrbitIntColor = rgbColor.GetIntColor();
      }
      else
      {
         std::string colorStr = RgbColor::ToRgbString(rgbColor.GetIntColor());
         theClonedSpacePoint->
            SetStringParameter(theClonedSpacePoint->GetParameterID("OrbitColor"), colorStr);
      }
   }
   else if (event.GetEventObject() == mTargetColorCtrl)
   {
      wxColour wxcolor = mTargetColorCtrl->GetColour();
      RgbColor rgbColor = RgbColor(wxcolor.Red(), wxcolor.Green(), wxcolor.Blue());
      if (mUseInputObjectColor)
      {
         mTargetIntColor = rgbColor.GetIntColor();
      }
      else
      {
         std::string colorStr = RgbColor::ToRgbString(rgbColor.GetIntColor());
         theClonedSpacePoint->
            SetStringParameter(theClonedSpacePoint->GetParameterID("TargetColor"), colorStr);
      }
   }
   
	mHasColorChanged = true;
	theParentGmatPanel->EnableUpdate(true);
   
   #ifdef DEBUG_COLOR_CHANGE
   MessageInterface::ShowMessage("GmatColorPanel::OnColorPickerChange() leaving\n");
   #endif
}
コード例 #3
0
//------------------------------------------------------------------------------
// void OnColorPickerChange(wxColourPickerEvent& event)
//------------------------------------------------------------------------------
void GroundTrackPlotPanel::OnColorPickerChange(wxColourPickerEvent& event)
{
   #ifdef DEBUG_PANEL_COLOR
   MessageInterface::ShowMessage("GroundTrackPlotPanel::OnColorPickerChange() entered\n");
   #endif
   
   wxObject *obj = event.GetEventObject();
   std::string selObjName = mObjectCheckListBox->GetStringSelection().c_str();
   
   if (obj == mOrbitColorCtrl)
   {
      mOrbitColor = mOrbitColorCtrl->GetColour();
      mOrbitColorMap[selObjName].Set(mOrbitColor.Red(),
                                     mOrbitColor.Green(),
                                     mOrbitColor.Blue(), 0);
      
      #ifdef DEBUG_PANEL_COLOR
      MessageInterface::ShowMessage("   Orbit color changed\n");
      MessageInterface::ShowMessage
         ("   red=%u, green=%u, blue=%u, alpha=%u\n", mOrbitColor.Red(),
          mOrbitColor.Green(), mOrbitColor.Blue(), mOrbitColor.Alpha());
      UnsignedInt intColor = mOrbitColorMap[selObjName].GetIntColor();
      MessageInterface::ShowMessage
         ("   mOrbitColorMap[%s]=%u<%08X>\n", selObjName.c_str(), intColor, intColor);
      #endif
      
      mHasOrbitColorChanged = true;
   }
   else if (obj == mTargetColorCtrl)
   {
      mTargetColor = mTargetColorCtrl->GetColour();
      mTargetColorMap[selObjName].Set(mTargetColor.Red(),
                                      mTargetColor.Green(),
                                      mTargetColor.Blue(), 0);
      
      #ifdef DEBUG_PANEL_COLOR
      MessageInterface::ShowMessage("   Target color changed\n");
      MessageInterface::ShowMessage
         ("   red=%u, green=%u, blue=%u, alpha=%u\n", mTargetColor.Red(),
          mTargetColor.Green(), mTargetColor.Blue(), mTargetColor.Alpha());
      UnsignedInt intColor = mTargetColorMap[selObjName].GetIntColor();
      MessageInterface::ShowMessage
         ("   mTargetColorMap[%s]=%u<%08X>\n", selObjName.c_str(), intColor, intColor);
      #endif
      
      mHasTargetColorChanged = true;
   }
   
   EnableUpdate(true);
   
   #ifdef DEBUG_PANEL_COLOR
   MessageInterface::ShowMessage("GroundTrackPlotPanel::OnColorPickerChange() entered\n");
   #endif
}