this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
+ // ColorDialog1
+ //
+ this.ColorDialog1.AnyColor = true;
+ //
+ // FontDialog1
+ //
+ this.FontDialog1.AllowVerticalFonts = false;
+ this.FontDialog1.FontMustExist = true;
+ this.FontDialog1.ShowColor = true;
+ //
// AppendSettingDialog
//
resources.ApplyResources(this, "$this");
}
}
- private void btnFontAndColor_Click(object sender, EventArgs e) // Handles btnUnread.Click, btnDetail.Click, btnListFont.Click, btnInputFont.Click
- {
- Button Btn = (Button) sender;
- DialogResult rtn;
-
- FontDialog1.AllowVerticalFonts = false;
- FontDialog1.AllowScriptChange = true;
- FontDialog1.AllowSimulations = true;
- FontDialog1.AllowVectorFonts = true;
- FontDialog1.FixedPitchOnly = false;
- FontDialog1.FontMustExist = true;
- FontDialog1.ScriptsOnly = false;
- FontDialog1.ShowApply = false;
- FontDialog1.ShowEffects = true;
- FontDialog1.ShowColor = true;
-
- switch (Btn.Name)
- {
- case "btnUnread":
- FontDialog1.Color = this.FontPanel.lblUnread.ForeColor;
- FontDialog1.Font = this.FontPanel.lblUnread.Font;
- break;
- case "btnDetail":
- FontDialog1.Color = this.FontPanel.lblDetail.ForeColor;
- FontDialog1.Font = this.FontPanel.lblDetail.Font;
- break;
- case "btnListFont":
- FontDialog1.Color = this.FontPanel.lblListFont.ForeColor;
- FontDialog1.Font = this.FontPanel.lblListFont.Font;
- break;
- case "btnInputFont":
- FontDialog1.Color = this.FontPanel2.lblInputFont.ForeColor;
- FontDialog1.Font = this.FontPanel2.lblInputFont.Font;
- break;
- }
-
- try
- {
- rtn = FontDialog1.ShowDialog();
- }
- catch(ArgumentException ex)
- {
- MessageBox.Show(ex.Message);
- return;
- }
-
- if (rtn == DialogResult.Cancel) return;
-
- switch (Btn.Name)
- {
- case "btnUnread":
- this.FontPanel.lblUnread.ForeColor = FontDialog1.Color;
- this.FontPanel.lblUnread.Font = FontDialog1.Font;
- break;
- case "btnDetail":
- this.FontPanel.lblDetail.ForeColor = FontDialog1.Color;
- this.FontPanel.lblDetail.Font = FontDialog1.Font;
- break;
- case "btnListFont":
- this.FontPanel.lblListFont.ForeColor = FontDialog1.Color;
- this.FontPanel.lblListFont.Font = FontDialog1.Font;
- break;
- case "btnInputFont":
- this.FontPanel2.lblInputFont.ForeColor = FontDialog1.Color;
- this.FontPanel2.lblInputFont.Font = FontDialog1.Font;
- break;
- }
-
- }
-
- private void btnColor_Click(object sender, EventArgs e) //Handles btnSelf.Click, btnAtSelf.Click, btnTarget.Click, btnAtTarget.Click, btnAtFromTarget.Click, btnFav.Click, btnOWL.Click, btnInputBackcolor.Click, btnAtTo.Click, btnListBack.Click, btnDetailBack.Click, btnDetailLink.Click, btnRetweet.Click
- {
- Button Btn = (Button)sender;
- DialogResult rtn;
-
- ColorDialog1.AllowFullOpen = true;
- ColorDialog1.AnyColor = true;
- ColorDialog1.FullOpen = false;
- ColorDialog1.SolidColorOnly = false;
-
- switch (Btn.Name)
- {
- case "btnSelf":
- ColorDialog1.Color = this.FontPanel2.lblSelf.BackColor;
- break;
- case "btnAtSelf":
- ColorDialog1.Color = this.FontPanel2.lblAtSelf.BackColor;
- break;
- case "btnTarget":
- ColorDialog1.Color = this.FontPanel2.lblTarget.BackColor;
- break;
- case "btnAtTarget":
- ColorDialog1.Color = this.FontPanel2.lblAtTarget.BackColor;
- break;
- case "btnAtFromTarget":
- ColorDialog1.Color = this.FontPanel2.lblAtFromTarget.BackColor;
- break;
- case "btnFav":
- ColorDialog1.Color = this.FontPanel.lblFav.ForeColor;
- break;
- case "btnOWL":
- ColorDialog1.Color = this.FontPanel.lblOWL.ForeColor;
- break;
- case "btnRetweet":
- ColorDialog1.Color = this.FontPanel.lblRetweet.ForeColor;
- break;
- case "btnInputBackcolor":
- ColorDialog1.Color = this.FontPanel2.lblInputBackcolor.BackColor;
- break;
- case "btnAtTo":
- ColorDialog1.Color = this.FontPanel2.lblAtTo.BackColor;
- break;
- case "btnListBack":
- ColorDialog1.Color = this.FontPanel2.lblListBackcolor.BackColor;
- break;
- case "btnDetailBack":
- ColorDialog1.Color = this.FontPanel.lblDetailBackcolor.BackColor;
- break;
- case "btnDetailLink":
- ColorDialog1.Color = this.FontPanel.lblDetailLink.ForeColor;
- break;
- }
-
- rtn = ColorDialog1.ShowDialog();
-
- if (rtn == DialogResult.Cancel) return;
-
- switch (Btn.Name)
- {
- case "btnSelf":
- this.FontPanel2.lblSelf.BackColor = ColorDialog1.Color;
- break;
- case "btnAtSelf":
- this.FontPanel2.lblAtSelf.BackColor = ColorDialog1.Color;
- break;
- case "btnTarget":
- this.FontPanel2.lblTarget.BackColor = ColorDialog1.Color;
- break;
- case "btnAtTarget":
- this.FontPanel2.lblAtTarget.BackColor = ColorDialog1.Color;
- break;
- case "btnAtFromTarget":
- this.FontPanel2.lblAtFromTarget.BackColor = ColorDialog1.Color;
- break;
- case "btnFav":
- this.FontPanel.lblFav.ForeColor = ColorDialog1.Color;
- break;
- case "btnOWL":
- this.FontPanel.lblOWL.ForeColor = ColorDialog1.Color;
- break;
- case "btnRetweet":
- this.FontPanel.lblRetweet.ForeColor = ColorDialog1.Color;
- break;
- case "btnInputBackcolor":
- this.FontPanel2.lblInputBackcolor.BackColor = ColorDialog1.Color;
- break;
- case "btnAtTo":
- this.FontPanel2.lblAtTo.BackColor = ColorDialog1.Color;
- break;
- case "btnListBack":
- this.FontPanel2.lblListBackcolor.BackColor = ColorDialog1.Color;
- break;
- case "btnDetailBack":
- this.FontPanel.lblDetailBackcolor.BackColor = ColorDialog1.Color;
- break;
- case "btnDetailLink":
- this.FontPanel.lblDetailLink.ForeColor = ColorDialog1.Color;
- break;
- }
- }
-
public string RecommendStatusText { get; set; }
private bool StartAuth()
this.BasedPanel.CreateAccountButton.Click += this.CreateAccountButton_Click;
this.GetPeriodPanel.CheckPostAndGet.CheckedChanged += this.CheckPostAndGet_CheckedChanged;
this.ActionPanel.UReadMng.CheckedChanged += this.UReadMng_CheckedChanged;
- this.FontPanel.btnUnread.Click += this.btnFontAndColor_Click;
- this.FontPanel.btnDetail.Click += this.btnFontAndColor_Click;
- this.FontPanel.btnListFont.Click += this.btnFontAndColor_Click;
- this.FontPanel.btnFav.Click += this.btnColor_Click;
- this.FontPanel.btnOWL.Click += this.btnColor_Click;
- this.FontPanel.btnRetweet.Click += this.btnColor_Click;
- this.FontPanel.btnDetailBack.Click += this.btnColor_Click;
- this.FontPanel.btnDetailLink.Click += this.btnColor_Click;
- this.FontPanel2.btnInputFont.Click += this.btnFontAndColor_Click;
- this.FontPanel2.btnSelf.Click += this.btnColor_Click;
- this.FontPanel2.btnAtSelf.Click += this.btnColor_Click;
- this.FontPanel2.btnTarget.Click += this.btnColor_Click;
- this.FontPanel2.btnAtTarget.Click += this.btnColor_Click;
- this.FontPanel2.btnAtFromTarget.Click += this.btnColor_Click;
- this.FontPanel2.btnInputBackcolor.Click += this.btnColor_Click;
- this.FontPanel2.btnAtTo.Click += this.btnColor_Click;
- this.FontPanel2.btnListBack.Click += this.btnColor_Click;
this.Icon = Properties.Resources.MIcon;
}
resources.ApplyResources(this.btnRetweet, "btnRetweet");
this.btnRetweet.Name = "btnRetweet";
this.btnRetweet.UseVisualStyleBackColor = true;
+ this.btnRetweet.Click += new System.EventHandler(this.btnRetweet_Click);
//
// lblRetweet
//
resources.ApplyResources(this.btnDetailLink, "btnDetailLink");
this.btnDetailLink.Name = "btnDetailLink";
this.btnDetailLink.UseVisualStyleBackColor = true;
+ this.btnDetailLink.Click += new System.EventHandler(this.btnDetailLink_Click);
//
// lblDetailLink
//
resources.ApplyResources(this.btnUnread, "btnUnread");
this.btnUnread.Name = "btnUnread";
this.btnUnread.UseVisualStyleBackColor = true;
+ this.btnUnread.Click += new System.EventHandler(this.btnUnread_Click);
//
// lblUnread
//
resources.ApplyResources(this.btnDetailBack, "btnDetailBack");
this.btnDetailBack.Name = "btnDetailBack";
this.btnDetailBack.UseVisualStyleBackColor = true;
+ this.btnDetailBack.Click += new System.EventHandler(this.btnDetailBack_Click);
//
// lblDetailBackcolor
//
resources.ApplyResources(this.btnDetail, "btnDetail");
this.btnDetail.Name = "btnDetail";
this.btnDetail.UseVisualStyleBackColor = true;
+ this.btnDetail.Click += new System.EventHandler(this.btnDetail_Click);
//
// lblDetail
//
resources.ApplyResources(this.btnOWL, "btnOWL");
this.btnOWL.Name = "btnOWL";
this.btnOWL.UseVisualStyleBackColor = true;
+ this.btnOWL.Click += new System.EventHandler(this.btnOWL_Click);
//
// lblOWL
//
resources.ApplyResources(this.btnFav, "btnFav");
this.btnFav.Name = "btnFav";
this.btnFav.UseVisualStyleBackColor = true;
+ this.btnFav.Click += new System.EventHandler(this.btnFav_Click);
//
// lblFav
//
resources.ApplyResources(this.btnListFont, "btnListFont");
this.btnListFont.Name = "btnListFont";
this.btnListFont.UseVisualStyleBackColor = true;
+ this.btnListFont.Click += new System.EventHandler(this.btnListFont_Click);
//
// lblListFont
//
lblRetweet.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Green);
}
+
+ private void btnListFont_Click(object sender, EventArgs e)
+ {
+ this.ShowFontDialog(this.lblListFont);
+ }
+
+ private void btnUnread_Click(object sender, EventArgs e)
+ {
+ this.ShowFontDialog(this.lblUnread);
+ }
+
+ private void btnFav_Click(object sender, EventArgs e)
+ {
+ this.ShowForeColorDialog(this.lblFav);
+ }
+
+ private void btnOWL_Click(object sender, EventArgs e)
+ {
+ this.ShowForeColorDialog(this.lblOWL);
+ }
+
+ private void btnRetweet_Click(object sender, EventArgs e)
+ {
+ this.ShowForeColorDialog(this.lblRetweet);
+ }
+
+ private void btnDetail_Click(object sender, EventArgs e)
+ {
+ this.ShowFontDialog(this.lblDetail);
+ }
+
+ private void btnDetailLink_Click(object sender, EventArgs e)
+ {
+ this.ShowForeColorDialog(this.lblDetailLink);
+ }
+
+ private void btnDetailBack_Click(object sender, EventArgs e)
+ {
+ this.ShowBackColorDialog(this.lblDetailBackcolor);
+ }
}
}
resources.ApplyResources(this.btnInputFont, "btnInputFont");
this.btnInputFont.Name = "btnInputFont";
this.btnInputFont.UseVisualStyleBackColor = true;
+ this.btnInputFont.Click += new System.EventHandler(this.btnInputFont_Click);
//
// btnInputBackcolor
//
resources.ApplyResources(this.btnInputBackcolor, "btnInputBackcolor");
this.btnInputBackcolor.Name = "btnInputBackcolor";
this.btnInputBackcolor.UseVisualStyleBackColor = true;
+ this.btnInputBackcolor.Click += new System.EventHandler(this.btnInputBackcolor_Click);
//
// btnAtTo
//
resources.ApplyResources(this.btnAtTo, "btnAtTo");
this.btnAtTo.Name = "btnAtTo";
this.btnAtTo.UseVisualStyleBackColor = true;
+ this.btnAtTo.Click += new System.EventHandler(this.btnAtTo_Click);
//
// btnListBack
//
resources.ApplyResources(this.btnListBack, "btnListBack");
this.btnListBack.Name = "btnListBack";
this.btnListBack.UseVisualStyleBackColor = true;
+ this.btnListBack.Click += new System.EventHandler(this.btnListBack_Click);
//
// btnAtFromTarget
//
resources.ApplyResources(this.btnAtFromTarget, "btnAtFromTarget");
this.btnAtFromTarget.Name = "btnAtFromTarget";
this.btnAtFromTarget.UseVisualStyleBackColor = true;
+ this.btnAtFromTarget.Click += new System.EventHandler(this.btnAtFromTarget_Click);
//
// btnAtTarget
//
resources.ApplyResources(this.btnAtTarget, "btnAtTarget");
this.btnAtTarget.Name = "btnAtTarget";
this.btnAtTarget.UseVisualStyleBackColor = true;
+ this.btnAtTarget.Click += new System.EventHandler(this.btnAtTarget_Click);
//
// btnTarget
//
resources.ApplyResources(this.btnTarget, "btnTarget");
this.btnTarget.Name = "btnTarget";
this.btnTarget.UseVisualStyleBackColor = true;
+ this.btnTarget.Click += new System.EventHandler(this.btnTarget_Click);
//
// btnAtSelf
//
resources.ApplyResources(this.btnAtSelf, "btnAtSelf");
this.btnAtSelf.Name = "btnAtSelf";
this.btnAtSelf.UseVisualStyleBackColor = true;
+ this.btnAtSelf.Click += new System.EventHandler(this.btnAtSelf_Click);
//
// btnSelf
//
resources.ApplyResources(this.btnSelf, "btnSelf");
this.btnSelf.Name = "btnSelf";
this.btnSelf.UseVisualStyleBackColor = true;
+ this.btnSelf.Click += new System.EventHandler(this.btnSelf_Click);
//
// lblInputFont
//
lblListBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
}
+
+ private void btnSelf_Click(object sender, EventArgs e)
+ {
+ this.ShowBackColorDialog(this.lblSelf);
+ }
+
+ private void btnAtSelf_Click(object sender, EventArgs e)
+ {
+ this.ShowBackColorDialog(this.lblAtSelf);
+ }
+
+ private void btnTarget_Click(object sender, EventArgs e)
+ {
+ this.ShowBackColorDialog(this.lblTarget);
+ }
+
+ private void btnAtTarget_Click(object sender, EventArgs e)
+ {
+ this.ShowBackColorDialog(this.lblAtTarget);
+ }
+
+ private void btnAtFromTarget_Click(object sender, EventArgs e)
+ {
+ this.ShowBackColorDialog(this.lblAtFromTarget);
+ }
+
+ private void btnAtTo_Click(object sender, EventArgs e)
+ {
+ this.ShowBackColorDialog(this.lblAtTo);
+ }
+
+ private void btnListBack_Click(object sender, EventArgs e)
+ {
+ this.ShowBackColorDialog(this.lblListBackcolor);
+ }
+
+ private void btnInputBackcolor_Click(object sender, EventArgs e)
+ {
+ this.ShowBackColorDialog(this.lblInputBackcolor);
+ }
+
+ private void btnInputFont_Click(object sender, EventArgs e)
+ {
+ this.ShowFontDialog(this.lblInputFont);
+ }
}
}
{
InitializeComponent();
}
+
+ protected void ShowFontDialog(Label targetLabel)
+ {
+ var dialog = ((AppendSettingDialog)this.ParentForm).FontDialog1;
+
+ dialog.Font = targetLabel.Font;
+ dialog.Color = targetLabel.ForeColor;
+
+ DialogResult ret;
+ try
+ {
+ ret = dialog.ShowDialog(this.ParentForm);
+ }
+ catch (ArgumentException ex)
+ {
+ MessageBox.Show(this.ParentForm, ex.Message);
+ return;
+ }
+
+ if (ret == DialogResult.OK)
+ {
+ targetLabel.Font = dialog.Font;
+ targetLabel.ForeColor = dialog.Color;
+ }
+ }
+
+ protected void ShowForeColorDialog(Label targetLabel)
+ {
+ var dialog = ((AppendSettingDialog)this.ParentForm).ColorDialog1;
+
+ dialog.Color = targetLabel.ForeColor;
+
+ var ret = dialog.ShowDialog(this.ParentForm);
+
+ if (ret == DialogResult.OK)
+ {
+ targetLabel.ForeColor = dialog.Color;
+ }
+ }
+
+ protected void ShowBackColorDialog(Label targetLabel)
+ {
+ var dialog = ((AppendSettingDialog)this.ParentForm).ColorDialog1;
+
+ dialog.Color = targetLabel.BackColor;
+
+ var ret = dialog.ShowDialog(this.ParentForm);
+
+ if (ret == DialogResult.OK)
+ {
+ targetLabel.BackColor = dialog.Color;
+ }
+ }
}
}