void GradientsMergeMosaicInterface::UpdateTargetImageItem( size_type i ) { TreeBox::Node* node = GUI->TargetImages_TreeBox[i]; if ( node == 0 ) return; const GradientsMergeMosaicInstance::ImageItem& item = instance.targetFrames[i]; node->SetText( 0, String( i+1 ) ); node->SetAlignment( 0, TextAlign::Right ); node->SetIcon( 1, Bitmap( ScaledResource( item.enabled ? ":/icons/enabled.png" : ":/icons/disabled.png" ) ) ); node->SetAlignment( 1, TextAlign::Left ); node->SetIcon( 2, Bitmap( ScaledResource( ":/icons/document.png" ) ) ); if ( GUI->FullPaths_CheckBox.IsChecked() ) node->SetText( 2, item.path ); else { String fileName = File::ExtractName( item.path ) + File::ExtractExtension( item.path ); node->SetText( 2, fileName ); node->SetToolTip( 2, item.path ); } node->SetAlignment( 2, TextAlign::Left ); }
void STFSliders::RebuildGradient() { Rect r = BoundsRect(); int w = r.Width(); int h = r.Height(); gradient = Bitmap( w, h, BitmapFormat::RGB32 ); Graphics g( gradient ); bool c0 = channel == 0 || channel == 3 || !rgb && channel == 0; bool c1 = channel == 1 || channel == 3 || !rgb && channel == 0; bool c2 = channel == 2 || channel == 3 || !rgb && channel == 0; GradientBrush::stop_list stops; stops.Add( GradientBrush::Stop( 0.0, RGBAColor( float( c0 ? v0 : 0.0 ), float( c1 ? v0 : 0.0 ), float( c2 ? v0 : 0.0 ) ) ) ); stops.Add( GradientBrush::Stop( 1.0, RGBAColor( float( c0 ? v1 : 0.0 ), float( c1 ? v1 : 0.0 ), float( c2 ? v1 : 0.0 ) ) ) ); g.FillRect( r, LinearGradientBrush( 0, 0, w, 0, stops ) ); g.SetPen( RGBAColor( 0, 0, 0 ) ); g.SetBrush( Brush::Null() ); g.DrawRect( r ); if ( !rgb && channel > 0 ) { Bitmap b( ScaledResource( ":/browser/disabled.png" ) ); int d = (h - b.Height()) >> 1; g.DrawBitmap( d, d, b ); }
SectionBar::SectionBar( Control& parent ) : Control( parent ), m_section( nullptr ) { SetObjectId( "IWSectionBar" ); SetFocusStyle( FocusStyle::NoFocus ); SetSizer( Global_Sizer ); Global_Sizer.AddSpacing( 1 ); Global_Sizer.Add( Title_Sizer ); Global_Sizer.AddSpacing( 1 ); Title_Sizer.AddSpacing( 4 ); Title_Sizer.Add( Title_Label ); Title_Sizer.AddStretch(); Title_Sizer.Add( Title_ToolButton ); Title_Sizer.AddSpacing( 4 ); Title_Label.SetText( String( 'M' ) ); Title_Label.SetTextAlignment( TextAlign::Left|TextAlign::VertCenter ); Title_Label.SetText( String() ); Title_ToolButton.SetIcon( Bitmap( ScaledResource( contract_icon ) ) ); Title_ToolButton.SetScaledFixedSize( 17, 17 ); Title_ToolButton.SetFocusStyle( FocusStyle::NoFocus ); Title_ToolButton.OnClick( (Button::click_event_handler)&SectionBar::ButtonClick, *this ); AdjustToContents(); SetFixedHeight(); OnMousePress( (Control::mouse_button_event_handler)&SectionBar::MousePress, *this ); OnShow( (Control::event_handler)&SectionBar::ControlShow, *this ); }
void SectionBar::ControlShow( Control& sender ) { if ( m_section != nullptr ) { const char* iconResource = nullptr; if ( sender == *m_section ) iconResource = contract_icon; else if ( sender == *this ) { if ( m_section->IsVisible() ) iconResource = contract_icon; else iconResource = expand_icon; } if ( iconResource != nullptr ) Title_ToolButton.SetIcon( Bitmap( ScaledResource( iconResource ) ) ); } }
void SectionBar::SetSection( Control& section ) { if ( m_section != nullptr ) { m_section->OnShow( nullptr, Control::Null() ); m_section->OnHide( nullptr, Control::Null() ); m_section = nullptr; } if ( section.IsNull() ) return; m_section = §ion; m_section->OnShow( (Control::event_handler)&SectionBar::ControlShow, *this ); m_section->OnHide( (Control::event_handler)&SectionBar::ControlHide, *this ); Title_ToolButton.SetIcon( Bitmap( ScaledResource( m_section->IsVisible() ? contract_icon : expand_icon ) ) ); }
void HDRCompositionInterface::UpdateInputImagesItem( size_type i ) { TreeBox::Node* node = GUI->InputImages_TreeBox[i]; if ( node == 0 ) return; const HDRCompositionInstance::ImageItem& item = instance.images[i]; node->SetText( 0, String( i+1 ) ); node->SetAlignment( 0, TextAlign::Right ); node->SetIcon( 1, Bitmap( ScaledResource( item.enabled ? ":/browser/enabled.png" : ":/browser/disabled.png" ) ) ); node->SetAlignment( 1, TextAlign::Left ); if ( GUI->FullPaths_CheckBox.IsChecked() ) node->SetText( 2, item.path ); else node->SetText( 2, File::ExtractNameAndSuffix( item.path ) ); node->SetToolTip( 2, item.path ); node->SetAlignment( 2, TextAlign::Left ); }
void SectionBar::ControlHide( Control& sender ) { if ( m_section != 0 && sender == *m_section ) Title_ToolButton.SetIcon( Bitmap( ScaledResource( expand_icon ) ) ); }