Add a 'tips' dialog. Still needs to be mostly filled out with tips

This commit is contained in:
baldurk
2015-07-08 00:18:58 +02:00
parent 8e37133d69
commit 44adfc7b82
4 changed files with 461 additions and 1 deletions
+212
View File
@@ -0,0 +1,212 @@
namespace renderdocui.Windows.Dialogs
{
partial class TipsDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.Button close;
System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
this.randomTip = new System.Windows.Forms.Button();
this.nextTip = new System.Windows.Forms.Button();
this.tipBox = new System.Windows.Forms.GroupBox();
this.tipTitle = new System.Windows.Forms.Label();
this.tipPicture = new System.Windows.Forms.PictureBox();
this.tipLink = new System.Windows.Forms.LinkLabel();
this.tipText = new System.Windows.Forms.TextBox();
close = new System.Windows.Forms.Button();
tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
tableLayoutPanel1.SuspendLayout();
this.tipBox.SuspendLayout();
tableLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tipPicture)).BeginInit();
this.SuspendLayout();
//
// close
//
close.DialogResult = System.Windows.Forms.DialogResult.OK;
close.Location = new System.Drawing.Point(472, 295);
close.Name = "close";
close.Size = new System.Drawing.Size(75, 23);
close.TabIndex = 0;
close.Text = "Close";
close.UseVisualStyleBackColor = true;
//
// tableLayoutPanel1
//
tableLayoutPanel1.ColumnCount = 3;
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
tableLayoutPanel1.Controls.Add(this.randomTip, 0, 1);
tableLayoutPanel1.Controls.Add(close, 2, 1);
tableLayoutPanel1.Controls.Add(this.nextTip, 1, 1);
tableLayoutPanel1.Controls.Add(this.tipBox, 0, 0);
tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
tableLayoutPanel1.Name = "tableLayoutPanel1";
tableLayoutPanel1.RowCount = 2;
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel1.Size = new System.Drawing.Size(550, 321);
tableLayoutPanel1.TabIndex = 0;
//
// randomTip
//
this.randomTip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.randomTip.Location = new System.Drawing.Point(311, 295);
this.randomTip.Name = "randomTip";
this.randomTip.Size = new System.Drawing.Size(74, 23);
this.randomTip.TabIndex = 3;
this.randomTip.Text = "Random Tip";
this.randomTip.UseVisualStyleBackColor = true;
this.randomTip.Click += new System.EventHandler(this.LoadRandomTip);
//
// nextTip
//
this.nextTip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.nextTip.Location = new System.Drawing.Point(391, 295);
this.nextTip.Name = "nextTip";
this.nextTip.Size = new System.Drawing.Size(75, 23);
this.nextTip.TabIndex = 1;
this.nextTip.Text = "Next Tip";
this.nextTip.UseVisualStyleBackColor = true;
this.nextTip.Click += new System.EventHandler(this.LoadNextTip);
//
// tipBox
//
tableLayoutPanel1.SetColumnSpan(this.tipBox, 3);
this.tipBox.Controls.Add(tableLayoutPanel2);
this.tipBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.tipBox.Location = new System.Drawing.Point(3, 3);
this.tipBox.Name = "tipBox";
this.tipBox.Size = new System.Drawing.Size(544, 286);
this.tipBox.TabIndex = 2;
this.tipBox.TabStop = false;
this.tipBox.Text = "Tip #X";
//
// tableLayoutPanel2
//
tableLayoutPanel2.ColumnCount = 1;
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel2.Controls.Add(this.tipTitle, 0, 0);
tableLayoutPanel2.Controls.Add(this.tipPicture, 0, 2);
tableLayoutPanel2.Controls.Add(this.tipLink, 0, 3);
tableLayoutPanel2.Controls.Add(this.tipText, 0, 1);
tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
tableLayoutPanel2.Location = new System.Drawing.Point(3, 16);
tableLayoutPanel2.Name = "tableLayoutPanel2";
tableLayoutPanel2.RowCount = 4;
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
tableLayoutPanel2.Size = new System.Drawing.Size(538, 267);
tableLayoutPanel2.TabIndex = 0;
//
// tipTitle
//
this.tipTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tipTitle.AutoSize = true;
this.tipTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tipTitle.Location = new System.Drawing.Point(3, 0);
this.tipTitle.Name = "tipTitle";
this.tipTitle.Size = new System.Drawing.Size(532, 25);
this.tipTitle.TabIndex = 0;
this.tipTitle.Text = "Tip #X: Tip Title";
this.tipTitle.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// tipPicture
//
this.tipPicture.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.tipPicture.Location = new System.Drawing.Point(243, 180);
this.tipPicture.Name = "tipPicture";
this.tipPicture.Size = new System.Drawing.Size(52, 54);
this.tipPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.tipPicture.TabIndex = 1;
this.tipPicture.TabStop = false;
//
// tipLink
//
this.tipLink.AutoSize = true;
this.tipLink.Location = new System.Drawing.Point(7, 244);
this.tipLink.Margin = new System.Windows.Forms.Padding(7);
this.tipLink.Name = "tipLink";
this.tipLink.Size = new System.Drawing.Size(141, 13);
this.tipLink.TabIndex = 3;
this.tipLink.TabStop = true;
this.tipLink.Text = "https://renderdoc.org/tips/1";
this.tipLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.tipLink_LinkClicked);
//
// tipText
//
this.tipText.BackColor = System.Drawing.SystemColors.Window;
this.tipText.Dock = System.Windows.Forms.DockStyle.Fill;
this.tipText.Location = new System.Drawing.Point(3, 28);
this.tipText.Multiline = true;
this.tipText.Name = "tipText";
this.tipText.ReadOnly = true;
this.tipText.Size = new System.Drawing.Size(532, 146);
this.tipText.TabIndex = 4;
this.tipText.Text = "Tip Text";
//
// TipsDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(550, 321);
this.Controls.Add(tableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(556, 346);
this.Name = "TipsDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "RenderDoc Tips";
this.Load += new System.EventHandler(this.LoadRandomTip);
tableLayoutPanel1.ResumeLayout(false);
this.tipBox.ResumeLayout(false);
tableLayoutPanel2.ResumeLayout(false);
tableLayoutPanel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.tipPicture)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button nextTip;
private System.Windows.Forms.GroupBox tipBox;
private System.Windows.Forms.Label tipTitle;
private System.Windows.Forms.PictureBox tipPicture;
private System.Windows.Forms.LinkLabel tipLink;
private System.Windows.Forms.TextBox tipText;
private System.Windows.Forms.Button randomTip;
}
}
+110
View File
@@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace renderdocui.Windows.Dialogs
{
public partial class TipsDialog : Form
{
struct Tip
{
public Tip(string tt, string tx, Bitmap im)
{
title = tt;
text = tx;
image = im;
}
public string title;
public string text;
public Bitmap image;
}
private List<Tip> m_Tips = new List<Tip>();
private Random m_Rand = new Random();
private int m_CurrentTip = 0;
public TipsDialog()
{
InitializeComponent();
Icon = global::renderdocui.Properties.Resources.icon;
m_Tips.Add(new Tip(
"Talk to me!",
"RenderDoc is a labour of love and developed entirely in my spare time. If you run into a bug, have a feature " +
"request or just have a question about it, please feel free to get in touch and I'm always happy to talk and " +
"help out in any way I can - baldurk@baldurk.org.",
null));
m_Tips.Add(new Tip(
"Quick channel toggling",
"You can quickly toggle between RGB and Alpha in the Texture Viewer by right clicking on A - alpha.\n\n" +
"In general right clicking on a channel will toggle between only showing that channel, and showing all other " +
"channels except it.",
null));
m_Tips.Add(new Tip(
"Quick autofit follow",
"If you right click on the 'autofit' wand in the texture viewer, it will be locked on until you right " +
"click again. This means when you change texture or step through events, it will re-fit the texture " +
"continuously.\n\n" +
"This can be useful if you are e.g. jumping between a texture with a very compressed range like a depth " +
"texture and a normal render target.",
global::renderdocui.Properties.Resources.topo_trilist));
}
private void LoadRandomTip(object sender, EventArgs e)
{
int cur = m_CurrentTip;
// ensure we at least switch to a different tip
while(m_CurrentTip == cur)
m_CurrentTip = m_Rand.Next(m_Tips.Count);
LoadTip();
}
private void LoadTip()
{
Tip tip = m_Tips[m_CurrentTip];
tipBox.Text = String.Format("Tip #{0}", m_CurrentTip + 1);
tipTitle.Text = String.Format("Tip #{0}: {1}", m_CurrentTip + 1, tip.title);
tipText.Text = tip.text;
tipLink.Text = String.Format("https://renderdoc.org/tips/{0}", m_CurrentTip + 1);
if (tip.image == null)
{
tipPicture.Image = null;
tipPicture.Visible = false;
}
else
{
tipPicture.Image = tip.image;
tipPicture.Visible = true;
}
}
private void LoadNextTip(object sender, EventArgs e)
{
m_CurrentTip++;
if (m_CurrentTip >= m_Tips.Count)
m_CurrentTip = 0;
LoadTip();
}
private void tipLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start(tipLink.Text);
}
}
}
+129
View File
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="close.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="tableLayoutPanel1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="tableLayoutPanel2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
+10 -1
View File
@@ -252,6 +252,12 @@
<Compile Include="Windows\Dialogs\TextureSaveDialog.Designer.cs">
<DependentUpon>TextureSaveDialog.cs</DependentUpon>
</Compile>
<Compile Include="Windows\Dialogs\TipsDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Windows\Dialogs\TipsDialog.Designer.cs">
<DependentUpon>TipsDialog.cs</DependentUpon>
</Compile>
<Compile Include="Windows\EventBrowser.cs">
<SubType>Form</SubType>
</Compile>
@@ -372,6 +378,9 @@
<EmbeddedResource Include="Windows\Dialogs\TextureSaveDialog.resx">
<DependentUpon>TextureSaveDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Windows\Dialogs\TipsDialog.resx">
<DependentUpon>TipsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Windows\EventBrowser.resx">
<DependentUpon>EventBrowser.cs</DependentUpon>
</EmbeddedResource>
@@ -532,4 +541,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>