保存桌面快捷方式 - - 设为首页 - 手机版
凹丫丫旗下网站:四字成语大全 - 故事大全 - 范文大全
您现在的位置: 范文大全 >> 理工论文 >> 计算机论文 >> 正文

酒杯上的碟


= TLabel.Create(Self);
with FStatus do
begin
Parent := Self;
SetBounds(10, 38, 25, 25);
BorderStyle := bsRaisedPanel;
end;

FResultEdit := TEdit.Create(Self);
FResultEdit.Parent := Self;
FResultEdit.SetBounds(5, 5, 240, 25);
FResultEdit.Alignment := taRightJustify;
FResultEdit.Font.Height := -13;
FResultEdit.Font.Name := 'Arial';
FResultEdit.Text := '0';
end;

procedure TCalculator.Calc(Sender: TObject);
const
MemoryStoreMap: array [Boolean] of string = (' M','');
var
ButtonType: TButtonType;
Temp: string;
TempValue: Single;
begin
ButtonType := TButtonType(TButton(Sender).Tag);

try
case ButtonType of
bt0..bt9:
begin
FBackSpaceValid := True;
if (FResultEdit.Text = '0') or (FCurrentValue = 0) then FResultEdit.Text := '';
FResultEdit.Text :=
FResultEdit.Text + Btns[ButtonType].Caption;
FCurrentValue := StrToFloat(FResultEdit.Text);
FRepeatValue := 0;
end;

btDecimal:
if Pos('.', FResultEdit.Text) < 1 then
begin
FCurrentValue := StrToFloat(FResultEdit.Text);
FLastValue := 0;
FResultEdit.Text :=
FResultEdit.Text + Btns[ButtonType].Caption;
end;

btPlusMinus:
begin
FCurrentValue := StrToFloat(FResultEdit.Text);
FCurrentValue := FCurrentValue * -1;
FResultEdit.Text := FloatToStr(FCurrentValue);
end;

btClearAll:
begin
FCurrentValue := 0;
FLastValue := 0;
FResultEdit.Text := '0';
FState := csNone;
end;

btClear:
begin
FCurrentValue := 0;
FResultEdit.Text := '0';
end;

btAdd:
begin
FCurrentValue := StrToFloat(FResultEdit.Text);
FState := csAdd;
FLastValue := FCurrentValue;
FCurrentValue := 0;
end;

btSubtract:
begin
FCurrentValue := StrToFloat(FResultEdit.Text);
FState := csSubtract;
FLastValue := FCurrentValue;
FCurrentValue := 0;
end;

btDivide:
begin
FCurrentValue := StrToFloat(FResultEdit.Text);
FState := csDivide;
FLastValue := FCurrentValue;
FCurrentValue := 0;
end;

btMultiply:
begin
FCurrentValue := StrToFloat(FResultEdit.Text);
FState := csMultiply;
FLastValue := FCurrentValue;
FCurrentValue := 0;
end;

btBackSpace:
if FBackSpaceValid then
begin
Temp := FResultEdit.Text;
Delete(Temp, Length(Temp),1);
if Temp = '' then Temp := '0';
FCurrentValue := StrToFloat(Temp);
FR

《酒杯上的碟(第6页)》
本文链接地址:http://www.oyaya.net/fanwen/view/173009.html

  • 上一篇范文: 网上订房之我见
  • 下一篇范文: 学生档案管理系统

  • ★温馨提示:你可以返回到 计算机论文 也可以利用本站页顶的站内搜索功能查找你想要的文章。