КАТЕГОРИИ: Архитектура-(3434)Астрономия-(809)Биология-(7483)Биотехнологии-(1457)Военное дело-(14632)Высокие технологии-(1363)География-(913)Геология-(1438)Государство-(451)Демография-(1065)Дом-(47672)Журналистика и СМИ-(912)Изобретательство-(14524)Иностранные языки-(4268)Информатика-(17799)Искусство-(1338)История-(13644)Компьютеры-(11121)Косметика-(55)Кулинария-(373)Культура-(8427)Лингвистика-(374)Литература-(1642)Маркетинг-(23702)Математика-(16968)Машиностроение-(1700)Медицина-(12668)Менеджмент-(24684)Механика-(15423)Науковедение-(506)Образование-(11852)Охрана труда-(3308)Педагогика-(5571)Полиграфия-(1312)Политика-(7869)Право-(5454)Приборостроение-(1369)Программирование-(2801)Производство-(97182)Промышленность-(8706)Психология-(18388)Религия-(3217)Связь-(10668)Сельское хозяйство-(299)Социология-(6455)Спорт-(42831)Строительство-(4793)Торговля-(5050)Транспорт-(2929)Туризм-(1568)Физика-(3942)Философия-(17015)Финансы-(26596)Химия-(22929)Экология-(12095)Экономика-(9961)Электроника-(8441)Электротехника-(4623)Энергетика-(12629)Юриспруденция-(1492)Ядерная техника-(1748) |
РАБОТА 5. Создание и просмотр рисунков
Begin Begin RichEdit1.SelAttributes.Name:='Times New Roman'; if SpeedButton1.Down and SpeedButton2.Down and SpeedButton3.Down then RichEdit1.SelAttributes.Style:=[fsBold, fsItalic, fsUnderline]; if not SpeedButton1.Down and not SpeedButton2.Down and not SpeedButton3.Down then RichEdit1.SelAttributes.Style:=[]; if SpeedButton1.Down and not SpeedButton2.Down and not SpeedButton3.Down then RichEdit1.SelAttributes.Style:=[fsBold]; if not SpeedButton1.Down and SpeedButton2.Down and not SpeedButton3.Down then RichEdit1.SelAttributes.Style:=[fsItalic]; if not SpeedButton1.Down and not SpeedButton2.Down and SpeedButton3.Down then RichEdit1.SelAttributes.Style:=[fsUnderline]; if SpeedButton1.Down and SpeedButton2.Down and not SpeedButton3.Down then RichEdit1.SelAttributes.Style:=[fsBold, fsItalic]; if SpeedButton1.Down and not SpeedButton2.Down and SpeedButton3.Down then RichEdit1.SelAttributes.Style:=[fsBold, fsUnderline]; if not SpeedButton1.Down and SpeedButton2.Down and SpeedButton3.Down then RichEdit1.SelAttributes.Style:=[fsItalic, fsUnderline];
if SpeedButton4.Down then RichEdit1.Paragraph.Alignment:=taLeftJustify; if SpeedButton5.Down then RichEdit1.Paragraph.Alignment:=taCenter; if SpeedButton6.Down then RichEdit1.Paragraph.Alignment:=taRightJustify;
RichEdit1.SelAttributes.Size:= SpinEdit1.Value;
if SpeedButton7.Down then RichEdit1.SelAttributes.Color:=clBlack; if SpeedButton8.Down then RichEdit1.SelAttributes.Color:=clRed; if SpeedButton9.Down then RichEdit1.SelAttributes.Color:=clBlue; if SpeedButton10.Down then RichEdit1.SelAttributes.Color:=clGreen;
StatusBar1.Panels[2].Text:=IntToStr(length(RichEdit1.Lines.Text)); RichEdit1.SetFocus; end; Пример 4б. Сконструируйте форму изображенную на рисунке.
Упражнение. Введите в таблицу ведомость зарплаты рабочих с полями: Ф.И.О, оклад, профсоюзный взнос 1%, пенсионный фонд 1%, подоходный налог 12%, к выдаче. Поля: Ф.И.О и оклад вводятся с клавиатуры, а остальные поля рассчитываются при нажатии на кнопку ОК. Решение. Один из вариантов обработчика нажатия кнопки ОК: procedure TForm1.BitBtn2Click(Sender: TObject); var i:integer; for i:=1 to strtoint(Edit1.Text) do begin StringGrid1.Cells[3,i]:=floattostr(strtofloat(StringGrid1.Cells[2,i])*0.01); StringGrid1.Cells[4,i]:=floattostr(strtofloat(StringGrid1.Cells[2,i])*0.01); StringGrid1.Cells[5,i]:=floattostr(strtofloat(StringGrid1.Cells[2,i])*0.12); StringGrid1.Cells[6,i]:=floattostr(strtofloat(StringGrid1.Cells[2,i])- strtofloat(StringGrid1.Cells[3,i])- strtofloat(StringGrid1.Cells[4,i])-
strtofloat(StringGrid1.Cells[5,i])); end ; end ; Пример 5а. Создайте приложение для просмотра рисунков. Причем рисунок можно открыть двумя способами: 1) указав имя файла и путь в окошке и нажав кнопку «ПРОСМОТР»; 2) через главное меню: ФАЙЛ-ОТКРЫТЬ. Сконструируйте форму изображенную на рисунке. Создайте обработчики событий OnClick · для кнопки «ПРОСМОТР»: Image1.Picture.LoadFromFile(Edit1.Text); · для пункта главного меню: ФАЙЛ-ОТКРЫТЬ: if OpenDialog1.Execute then Image1.Picture.LoadFromFile(OpenDialog1.FileName); Пример 5б. Сконструируйте форму изображенную на рисунке.
procedure TForm1.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Дата добавления: 2014-12-27; Просмотров: 379; Нарушение авторских прав?; Мы поможем в написании вашей работы! Нам важно ваше мнение! Был ли полезен опубликованный материал? Да | Нет |