示例#1
0
 private void cboColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if (!m_Loaded || cboFontColor.SelectedIndex < 0)
         {
             return;
         }
         var rc = cboFontColor.SelectedItem as Rectangle;
         if (rc == null)
         {
             return;
         }
         var sb = rc.Fill as SolidColorBrush;
         if (sb == null)
         {
             return;
         }
         m_Group.FontColor = System.Drawing.Color.FromArgb(sb.Color.A, sb.Color.R, sb.Color.G, sb.Color.B);
         PNStatic.DrawSkinlessPreview(m_Group, brdFrame, blkCaption, brdBody, blkBody);
         if (lstSkins.SelectedIndex >= 0)
         {
             PNStatic.DrawSkinPreview(m_Group, m_Group.Skin, imgSkin);
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
示例#2
0
 private void cboFonts_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if (!m_Loaded || cboFonts.SelectedIndex < 0)
         {
             return;
         }
         var lf   = (LOGFONT)e.AddedItems[0];
         var logF = new LOGFONT();
         logF.Init();
         logF.SetFontFace(lf.lfFaceName);
         logF.SetFontSize((int)cboFontSize.SelectedItem);
         m_Group.Font = logF;
         PNStatic.DrawSkinlessPreview(m_Group, brdFrame, blkCaption, brdBody, blkBody);
         if (lstSkins.SelectedIndex >= 0)
         {
             PNStatic.DrawSkinPreview(m_Group, m_Group.Skin, imgSkin);
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
示例#3
0
 private void pckBGSknls_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs <Color> e)
 {
     try
     {
         if (!m_Loaded)
         {
             return;
         }
         m_Group.Skinless.BackColor = e.NewValue;
         PNStatic.DrawSkinlessPreview(m_Group, brdFrame, blkCaption, brdBody, blkBody);
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
示例#4
0
        private void fillGroupProperties()
        {
            try
            {
                imgGroupIcon.Source = m_Group.Image;
                txtName.Text        = m_Group.Name;
                if (m_Group.ID == 0)
                {
                    //general
                    txtName.IsReadOnly = true;
                }
                pckBGSknls.SelectedColor = m_Group.Skinless.BackColor;
                PNStatic.DrawSkinlessPreview(m_Group, brdFrame, blkCaption, brdBody, blkBody);
                if (m_Group.Skin.SkinName != PNSkinDetails.NO_SKIN)
                {
                    lstSkins.SelectedItem =
                        lstSkins.Items.OfType <PNListBoxItem>().FirstOrDefault(it => it.Text == m_Group.Skin.SkinName);
                }
                else
                {
                    lstSkins.SelectedIndex = -1;
                }
                cboFonts.SelectedItem =
                    cboFonts.Items.OfType <LOGFONT>().FirstOrDefault(lf => lf.lfFaceName == m_Group.Font.lfFaceName);
                foreach (var t in from object t in cboFontColor.Items
                         let rc = t as Rectangle
                                  where rc != null
                                  let sb = rc.Fill as SolidColorBrush
                                           where sb != null
                                           where
                                           sb.Color ==
                                           Color.FromArgb(m_Group.FontColor.A, m_Group.FontColor.R, m_Group.FontColor.G,
                                                          m_Group.FontColor.B)
                                           select t)
                {
                    cboFontColor.SelectedItem = t;
                    break;
                }

                var fontHeight = m_Group.Font.GetFontSize();
                cboFontSize.SelectedItem = fontHeight;
            }
            catch (Exception ex)
            {
                PNStatic.LogException(ex);
            }
        }
示例#5
0
 private void cmdFontSknls_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var fc = new WndFontChooser(m_Group.Skinless.CaptionFont, m_Group.Skinless.CaptionColor)
         {
             Owner = this
         };
         var showDialog = fc.ShowDialog();
         if (showDialog != null && showDialog.Value)
         {
             m_Group.Skinless.CaptionFont  = fc.SelectedFont;
             m_Group.Skinless.CaptionColor = fc.SelectedColor;
             PNStatic.DrawSkinlessPreview(m_Group, brdFrame, blkCaption, brdBody, blkBody);
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }