Skip to content

Commit

Permalink
Cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragouf committed Aug 1, 2013
1 parent 7ef3141 commit 73d56d7
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 20 deletions.
20 changes: 10 additions & 10 deletions CbrConverter/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 62 additions & 10 deletions CbrConverter/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public partial class MainForm : Form
public MainForm()
{
InitializeComponent();
ToolTip tooltip = new ToolTip();
tooltip.SetToolTip(this.btn_showlog, "Show/Hide Logs");
}


Expand Down Expand Up @@ -180,37 +182,87 @@ private void lbl_about_Click(object sender, EventArgs e)
aboutform.ShowDialog();
}


private int LogTopPosition
{
get
{
Rectangle screenRectangle = RectangleToScreen(this.ClientRectangle);
int titleHeight = screenRectangle.Top - this.Top;
return this.textBoxLog.Top + titleHeight - 1;
}
}

private int LogBottomPosition
{
get
{
Rectangle screenRectangle = RectangleToScreen(this.ClientRectangle);
int titleHeight = screenRectangle.Top - this.Top;
return this.textBoxLog.Bottom + titleHeight + 4;
}
}

private void btn_showlog_Click(object sender, EventArgs e)
{
ToggleLog();
}

private void ToggleLog()
{
if (this.Size == new Size(525, 642))
if (this.Height >= this.LogBottomPosition)
{
//this.btn_showlog.Text = "show log";
HideLog();
}
else
{
//this.btn_showlog.Text = "hide log";
ShowLog();
}
}

private void ShowLog()
{
//this.btn_showlog.Text = "hide log";
this.btn_showlog.Image = global::CbrConverter.Properties.Resources.arrow_double_up;
this.Size = new Size(525, 642);
{
var timerSlide = new System.Windows.Forms.Timer();
timerSlide.Interval = 3;
timerSlide.Tick += delegate(object sender, EventArgs e)
{
var timer = (System.Windows.Forms.Timer)sender;
if (this.Height >= this.LogBottomPosition)
{
timer.Enabled = false;
this.Height = this.LogBottomPosition;
this.btn_showlog.Image = global::CbrConverter.Properties.Resources.arrow_double_up;
}
else
{
this.Height = this.Size.Height + 10;
}

};
timerSlide.Start();
}

private void HideLog()
{
//this.btn_showlog.Text = "show log";
this.btn_showlog.Image = global::CbrConverter.Properties.Resources.arrow_double_down;
this.Size = new Size(525, 326);
// just a slide effect
var timerSlide = new System.Windows.Forms.Timer();
timerSlide.Interval = 3;
timerSlide.Tick += delegate(object sender, EventArgs e)
{
var timer = (System.Windows.Forms.Timer)sender;
if (this.Height <= this.LogTopPosition)
{
timer.Enabled = false;
this.Height = this.LogTopPosition;
this.btn_showlog.Image = global::CbrConverter.Properties.Resources.arrow_double_down;
}
else
{
this.Height = this.Height - 10;
}

};
timerSlide.Start();
}

private void tbox_OuputFolder_Click(object sender, EventArgs e)
Expand Down
Binary file modified Compiled/CbrConverter.exe
Binary file not shown.

0 comments on commit 73d56d7

Please sign in to comment.