Расчет стоимости пластиковых оконных конструкций и дверей

Курсовой проект - Компьютеры, программирование

Другие курсовые по предмету Компьютеры, программирование

p>Glyph.LoadFromFile(dir+\Иконки\поворотный.bmp);end;end;

procedure TForm7.SpeedButton3Click(Sender: TObject);

begin

nam:=nam+#Откидной;

b1 := TBitBtn.Create(Self);

with b1 do begin

b1.Hint:=3;

Left := 20;

Top := 20;

Width := 60;

Height := 100;

Glyph.LoadFromFile(dir+\Иконки\откидной.bmp);

Parent := Panel2;end;end;

procedure TForm7.SpeedButton4Click(Sender: TObject);

begin

nam:=nam+#балкон1;

b1 := TBitBtn.Create(Self);

with b1 do begin

b1.Hint:=4;

Left := 20;

Top := 20;

Width := 60;

Height := 100;

Glyph.LoadFromFile(dir+\Иконки\балкон1.bmp);

Parent := Panel2;end;end;

procedure TForm7.SpeedButton5Click(Sender: TObject);

begin

nam:=nam+#Балкон2;

b1 := TBitBtn.Create(Self);

with b1 do begin

b1.Hint:=5;

Left := 20;

Top := 20;

Width := 60;

Height := 100;

Glyph.LoadFromFile(dir+\Иконки\балкон2.bmp);

Parent := Panel2;end;end;

procedure TForm7.SpeedButton6Click(Sender: TObject);

begin

nam:=nam+#Вход;

b1 := TBitBtn.Create(Self);

with b1 do begin

b1.Hint:=6;

Left := 20;

Top := 20;

Width := 60;

Height := 100;

Glyph.LoadFromFile(dir+\Иконки\вход.bmp);

Parent := Panel2;end;end;

procedure TForm7.Panel2MouseDown(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

const

SC_DragMove = $F012; { a magic number }

begin

ReleaseCapture;

if Msg1.Sender.ClassName=TBitBtn then

msg1.Sender.perform(WM_SysCommand, SC_DragMove, 0);

end;

procedure TForm7.ComboBox1Change(Sender: TObject);

begin

if ComboBox1.Text=Оконные модули then begin

SpeedButton1.Visible:=True;SpeedButton2.Visible:=True;

SpeedButton14.Visible:=True;SpeedButton15.Visible:=True;

SpeedButton16.Visible:=True;SpeedButton3.Visible:=True;

SpeedButton4.Visible:=False;SpeedButton5.Visible:=False;

SpeedButton6.Visible:=False; end else begin

SpeedButton4.Visible:=True;SpeedButton5.Visible:=True;

SpeedButton6.Visible:=True;SpeedButton1.Visible:=False;

SpeedButton2.Visible:=False;SpeedButton3.Visible:=False;

SpeedButton14.Visible:=False;SpeedButton15.Visible:=False;

SpeedButton16.Visible:=False;end;end;

procedure TForm7.FormCreate(Sender: TObject);

begin okn:=1;

SpeedButton1.Visible:=False;SpeedButton2.Visible:=False;

SpeedButton3.Visible:=False;SpeedButton4.Visible:=False;

SpeedButton5.Visible:=False;SpeedButton6.Visible:=False;

SpeedButton14.Visible:=False;SpeedButton15.Visible:=False;

SpeedButton16.Visible:=False; end;

procedure TForm7.SpeedButton8Click(Sender: TObject);

begin

if (Combobox3.Text=) or (Combobox2.Text=) then

Showmessage(Укажите тип профиля и ст.-пакета)

else begin

prof:=Combobox3.Text;

spak:=Combobox2.Text;

close;end;end;

procedure TForm7.SpeedButton9Click(Sender: TObject);

var B: TBitmap; srcRect,dstRect: TRect;

begin

if (put=) or (nam=)then Showmessage(Сначала загрузите цену!!!)

else begin

B:=TBitmap.Create;

with dstRect do begin

Left:=0;

Top:=0;

Right:=Panel2.Width+1;

Bottom:=Panel2.Height+1; end;

with srcRect do begin

Left:=Panel2.Left+145;

Right:=Panel2.Left+Panel2.Width+145;

Top:=Panel2.Top+10;

Bottom:=Panel2.Top+Panel2.Height+10; end;

B.Width:=Panel2.Width;

B.Height:=Panel2.Height;

B.Canvas.CopyRect(dstRect,Self.Canvas,srcRect);

B.PixelFormat:=pf1bit;

B.SaveToFile(dir+\temp\+inttostr(okn)+.bmp);

B.Free;form8.Show;end;end;

procedure TForm7.UpDown1Click(Sender: TObject; Button: TUDBtnType);

begin

if Msg1.Sender.ClassName=TBitBtn then

msg1.Sender.Width:=UpDown1.Position*3;end;

procedure TForm7.UpDown2Click(Sender: TObject; Button: TUDBtnType);

begin

if Msg1.Sender.ClassName=TBitBtn then

msg1.Sender.Height:=UpDown2.Position*3;end;

procedure TForm7.SpeedButton11Click(Sender: TObject);

Var p:integer;begin

if Msg1.Sender.ClassName=TBitBtn then begin

if msg1.Sender.Hint=1 then begin p:=pos(#Глухой,nam);delete(nam,p,7);msg1.Sender.Destroy;end;

if msg1.Sender.Hint=2 then begin p:=pos(#Поворотный,nam);delete(nam,p,11);msg1.Sender.Destroy;end;

if msg1.Sender.Hint=3 then begin p:=pos(#Откидной,nam);delete(nam,p,9);msg1.Sender.Destroy;end;

if msg1.Sender.Hint=4 then begin p:=pos(#балкон1,nam);delete(nam,p,8);msg1.Sender.Destroy;end;

if msg1.Sender.Hint=5 then begin p:=pos(#Балкон2,nam);delete(nam,p,8);msg1.Sender.Destroy;end;

if msg1.Sender.Hint=6 then begin p:=pos(#Вход,nam);delete(nam,p,5);msg1.Sender.Destroy;end;end;end;

procedure TForm7.SpeedButton13Click(Sender: TObject);

var B: TBitmap; srcRect,dstRect: TRect;

begin

B:=TBitmap.Create;

with dstRect do begin

Left:=0;

Top:=0;

Right:=Panel2.Width+1;

Bottom:=Panel2.Height+1; end;

with srcRect do begin

Left:=Panel2.Left+145;

Right:=Panel2.Left+Panel2.Width+145;

Top:=Panel2.Top+10;

Bottom:=Panel2.Top+Panel2.Height+10; end;

B.Width:=Panel2.Width;

B.Height:=Panel2.Height;

B.Canvas.CopyRect(dstRect,Self.Canvas,srcRect);

B.PixelFormat:=pf1bit;

B.SaveToFile(dir+\Шаблоны\+nam+.bmp);

ShowMessage(Шаблон успешно сохранился!);

B.Free;end;

procedure TForm7.SpeedButton12Click(Sender: TObject);

Var s:string;d,a:integer;

begin

if form7.OpenDialog1.Execute then begin

image2.Top:=Panel2.Top-10;

image2.Left:=Panel2.Left-130;

image2.AutoSize:=true;

image2.Transparent:=FaLSE;

Image2.Picture.LoadFromFile(OpenDialog1.FileName);

nam:=OpenDialog1.FileName;

getdir(0,s);d:=pos(s,nam);a:=pos(#,nam);

delete(nam,d,a-1);d:=pos(.,nam);

delete(nam,d,4);end;end;

procedure TForm7.SpeedButton14Click(Sender: TObject);

begin

nam:=nam+#Поворотный;

b1 := TBitBtn.Create(Self);

with b1 do begin

b1.Hint:=2;

Left := 20;

Top := 20;

Width := 60;

Height := 100;

Parent := Panel2;

Glyph.LoadFromFile(dir+\Иконки\поворотный1.bmp);end;end;

procedure TForm7.SpeedButton15Click(Sender: TObject);

begin

nam:=nam+#Поворотный;

b1 := TBitBtn.Create(Self);

with b1 do begin

b1.Hint:=2;

Left := 20;

Top := 20;

Width := 60;

Height := 100;

Parent := Panel2;

Glyph.LoadFromFile(dir+\Иконки\поворотный2.bmp);end;end;

procedure TForm7.SpeedButton16Click(Sender: TObject);

begin

nam:=nam+#Откидной;

b1 := TBitBtn.Create(Self);

with b1 do begin

b1.Hint:=3;

Left := 20;

Top := 20;

Width := 60;

Height := 100;

Glyph.LoadFromFile(dir+\Иконки\откидной2.bmp);

Parent := Panel2;end;end;

procedure TForm7.SpeedButton17Click(Sender: TObject);

begin

if (Combobox1.Text=)or(Combobox3.Text=)or(Combobox2.Text=) then

Showmessage(Введите все необходимые данные!) else begin

if combobox1.Text=Оконные модули then

fail:=\Цены\Окна\

else fail:=\Цены\Двери\;

if (Combobox3.Text=Exprof58mm)and (Combobox2.Text=Однокамерный) then

Put:=fail+Exprof58mm24.dat;

if (Combobox3.Text=Exprof58mm)and (Combobox2.Text=Двухкамерный) then

Put:=fail+Exprof58mm32.dat;

if (Combobox3.Text=Exprof58mm)and (Combobox2.Text=Одно стекло) then begin

Put:=fail+Exprof58mm24.dat;

odn:=1;end;

if (Combobox3.Text=Exprof101mm)and (Combobox2.Text=Однокамерный) then

Put:=fail+Exprof101mm24.dat;

if (Combobox3.Text=Exprof101mm)and (Combobox2.Text=Двухкамерный) then

Put:=fail+E