File: MaterialDialog.cs

package info (click to toggle)
opencascade 7.8.1%2Bdfsg1-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 293,924 kB
  • sloc: cpp: 1,249,635; tcl: 15,974; cs: 5,173; java: 1,554; sh: 1,354; ansic: 821; xml: 737; makefile: 30; javascript: 22
file content (248 lines) | stat: -rw-r--r-- 7,693 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace IE_WinForms
{
  /// <summary>
  /// Summary description for MaterialDialog.
  /// </summary>
  public class MaterialDialog : System.Windows.Forms.Form
  {
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.Container components = null;

    public MaterialDialog()
    {
      //
      // Required for Windows Form Designer support
      //
      InitializeComponent();

      //
      // TODO: Add any constructor code after InitializeComponent call
      //
      this.myView = null;
    }

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    protected override void Dispose(bool disposing)
    {
      if (disposing)
      {
        if (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.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MaterialDialog));
      this.BTN_PLASTER = new System.Windows.Forms.Button();
      this.BTN_BRASS = new System.Windows.Forms.Button();
      this.BTN_BRONZE = new System.Windows.Forms.Button();
      this.BTN_COPPER = new System.Windows.Forms.Button();
      this.BTN_GOLD = new System.Windows.Forms.Button();
      this.BTN_PEWTER = new System.Windows.Forms.Button();
      this.BTN_PLASTIC = new System.Windows.Forms.Button();
      this.BTN_SILVER = new System.Windows.Forms.Button();
      this.SuspendLayout();
      // 
      // BTN_PLASTER
      // 
      this.BTN_PLASTER.Location = new System.Drawing.Point(16, 8);
      this.BTN_PLASTER.Name = "BTN_PLASTER";
      this.BTN_PLASTER.Size = new System.Drawing.Size(80, 24);
      this.BTN_PLASTER.TabIndex = 0;
      this.BTN_PLASTER.Text = "Plaster";
      this.BTN_PLASTER.Click += new System.EventHandler(this.button1_Click);
      // 
      // BTN_BRASS
      // 
      this.BTN_BRASS.Location = new System.Drawing.Point(16, 40);
      this.BTN_BRASS.Name = "BTN_BRASS";
      this.BTN_BRASS.Size = new System.Drawing.Size(80, 24);
      this.BTN_BRASS.TabIndex = 1;
      this.BTN_BRASS.Text = "Brass";
      this.BTN_BRASS.Click += new System.EventHandler(this.BTN_BRASS_Click);
      // 
      // BTN_BRONZE
      // 
      this.BTN_BRONZE.Location = new System.Drawing.Point(16, 72);
      this.BTN_BRONZE.Name = "BTN_BRONZE";
      this.BTN_BRONZE.Size = new System.Drawing.Size(80, 24);
      this.BTN_BRONZE.TabIndex = 2;
      this.BTN_BRONZE.Text = "Bronze";
      this.BTN_BRONZE.Click += new System.EventHandler(this.BTN_BRONZE_Click);
      // 
      // BTN_COPPER
      // 
      this.BTN_COPPER.Location = new System.Drawing.Point(16, 104);
      this.BTN_COPPER.Name = "BTN_COPPER";
      this.BTN_COPPER.Size = new System.Drawing.Size(80, 24);
      this.BTN_COPPER.TabIndex = 3;
      this.BTN_COPPER.Text = "Copper";
      this.BTN_COPPER.Click += new System.EventHandler(this.BTN_COPPER_Click);
      // 
      // BTN_GOLD
      // 
      this.BTN_GOLD.Location = new System.Drawing.Point(16, 136);
      this.BTN_GOLD.Name = "BTN_GOLD";
      this.BTN_GOLD.Size = new System.Drawing.Size(80, 24);
      this.BTN_GOLD.TabIndex = 4;
      this.BTN_GOLD.Text = "Gold";
      this.BTN_GOLD.Click += new System.EventHandler(this.BTN_GOLD_Click);
      // 
      // BTN_PEWTER
      // 
      this.BTN_PEWTER.Location = new System.Drawing.Point(16, 168);
      this.BTN_PEWTER.Name = "BTN_PEWTER";
      this.BTN_PEWTER.Size = new System.Drawing.Size(80, 24);
      this.BTN_PEWTER.TabIndex = 5;
      this.BTN_PEWTER.Text = "Pewter";
      this.BTN_PEWTER.Click += new System.EventHandler(this.BTN_PEWTER_Click);
      // 
      // BTN_PLASTIC
      // 
      this.BTN_PLASTIC.Location = new System.Drawing.Point(16, 200);
      this.BTN_PLASTIC.Name = "BTN_PLASTIC";
      this.BTN_PLASTIC.Size = new System.Drawing.Size(80, 24);
      this.BTN_PLASTIC.TabIndex = 6;
      this.BTN_PLASTIC.Text = "Plastic";
      this.BTN_PLASTIC.Click += new System.EventHandler(this.BTN_PLASTIC_Click);
      // 
      // BTN_SILVER
      // 
      this.BTN_SILVER.Location = new System.Drawing.Point(16, 232);
      this.BTN_SILVER.Name = "BTN_SILVER";
      this.BTN_SILVER.Size = new System.Drawing.Size(80, 24);
      this.BTN_SILVER.TabIndex = 7;
      this.BTN_SILVER.Text = "Silver";
      this.BTN_SILVER.Click += new System.EventHandler(this.BTN_SILVER_Click);
      // 
      // MaterialDialog
      // 
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
      this.ClientSize = new System.Drawing.Size(112, 273);
      this.Controls.Add(this.BTN_SILVER);
      this.Controls.Add(this.BTN_PLASTIC);
      this.Controls.Add(this.BTN_PEWTER);
      this.Controls.Add(this.BTN_GOLD);
      this.Controls.Add(this.BTN_COPPER);
      this.Controls.Add(this.BTN_BRONZE);
      this.Controls.Add(this.BTN_BRASS);
      this.Controls.Add(this.BTN_PLASTER);
      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
      this.MaximizeBox = false;
      this.MinimizeBox = false;
      this.Name = "MaterialDialog";
      this.Text = "MaterialDialog";
      this.ResumeLayout(false);

    }
    #endregion

    private System.Windows.Forms.Button BTN_PLASTER;
    private System.Windows.Forms.Button BTN_BRASS;
    private System.Windows.Forms.Button BTN_BRONZE;
    private System.Windows.Forms.Button BTN_COPPER;
    private System.Windows.Forms.Button BTN_GOLD;
    private System.Windows.Forms.Button BTN_PEWTER;
    private System.Windows.Forms.Button BTN_PLASTIC;
    private System.Windows.Forms.Button BTN_SILVER;

    private int myMaterial;
    private OCCTProxy myView;

    private void button1_Click(object sender, System.EventArgs e)
    {
      this.myMaterial = 5;
      ChangeMaterial();
    }

    private void BTN_BRASS_Click(object sender, System.EventArgs e)
    {
      this.myMaterial = 0;
      ChangeMaterial();
    }

    private void BTN_BRONZE_Click(object sender, System.EventArgs e)
    {
      this.myMaterial = 1;
      ChangeMaterial();
    }

    private void BTN_COPPER_Click(object sender, System.EventArgs e)
    {
      this.myMaterial = 2;
      ChangeMaterial();
    }

    private void BTN_GOLD_Click(object sender, System.EventArgs e)
    {
      this.myMaterial = 3;
      ChangeMaterial();
    }

    private void BTN_PEWTER_Click(object sender, System.EventArgs e)
    {
      this.myMaterial = 4;
      ChangeMaterial();
    }

    private void BTN_PLASTIC_Click(object sender, System.EventArgs e)
    {
      this.myMaterial = 6;
      ChangeMaterial();
    }

    private void BTN_SILVER_Click(object sender, System.EventArgs e)
    {
      this.myMaterial = 7;
      ChangeMaterial();
    }

    public int Material
    {
      get
      {
        return this.myMaterial;
      }
      set
      {
        this.myMaterial = value;
      }
    }

    public void ChangeMaterial()
    {
      if (myView == null)
        return;
      myView.SetMaterial(this.myMaterial);

    }

    public OCCTProxy View
    {
      set
      {
        this.myView = value;
      }
    }

  }
}