home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 April A / Pcwk4a98.iso / PROGRAM / DELPHI16 / Calmira / Src / SRC / BINPROP.PAS < prev    next >
Pascal/Delphi Source File  |  1997-02-15  |  3KB  |  100 lines

  1. {**************************************************************************}
  2. {                                                                          }
  3. {    Calmira shell for Microsoft« Windows(TM) 3.1                          }
  4. {    Source Release 1.0                                                    }
  5. {    Copyright (C) 1997  Li-Hsin Huang                                     }
  6. {                                                                          }
  7. {    This program is free software; you can redistribute it and/or modify  }
  8. {    it under the terms of the GNU General Public License as published by  }
  9. {    the Free Software Foundation; either version 2 of the License, or     }
  10. {    (at your option) any later version.                                   }
  11. {                                                                          }
  12. {    This program is distributed in the hope that it will be useful,       }
  13. {    but WITHOUT ANY WARRANTY; without even the implied warranty of        }
  14. {    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         }
  15. {    GNU General Public License for more details.                          }
  16. {                                                                          }
  17. {    You should have received a copy of the GNU General Public License     }
  18. {    along with this program; if not, write to the Free Software           }
  19. {    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             }
  20. {                                                                          }
  21. {**************************************************************************}
  22.  
  23. unit Binprop;
  24.  
  25. interface
  26.  
  27. uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
  28.   StdCtrls, Spin, TabNotBk, ExtCtrls, Chklist;
  29.  
  30. type
  31.   TBinPropDlg = class(TForm)
  32.     OKBtn: TBitBtn;
  33.     CancelBtn: TBitBtn;
  34.     Notebook: TTabbedNotebook;
  35.     GroupBox1: TGroupBox;
  36.     rbLeave: TRadioButton;
  37.     rbDelete: TRadioButton;
  38.     rbClear: TRadioButton;
  39.     rbCollect: TRadioButton;
  40.     SizeEdit: TSpinEdit;
  41.     Label1: TLabel;
  42.     Label2: TLabel;
  43.     CapEdit: TEdit;
  44.     Label3: TLabel;
  45.     HelpBtn: TBitBtn;
  46.     cbIcons: TCheckBox;
  47.     cbDisable: TCheckBox;
  48.     Bevel1: TBevel;
  49.     procedure rbCollectClick(Sender: TObject);
  50.     procedure FormCreate(Sender: TObject);
  51.     procedure OKBtnClick(Sender: TObject);
  52.   private
  53.     { Private declarations }
  54.   public
  55.     { Public declarations }
  56.   end;
  57.  
  58. {
  59. var
  60.   BinPropDlg: TBinPropDlg;
  61. }
  62.  
  63. implementation
  64.  
  65. uses WasteBin, MiscUtil, Settings;
  66.  
  67. {$R *.DFM}
  68.  
  69. procedure TBinPropDlg.rbCollectClick(Sender: TObject);
  70. begin
  71.   SizeEdit.Enabled := rbCollect.Checked;
  72. end;
  73.  
  74. procedure TBinPropDlg.FormCreate(Sender: TObject);
  75. begin
  76.   Notebook.PageIndex := 0;
  77.   CapEdit.Text := BinCaption;
  78.   SetRadioIndex([rbLeave, rbDelete, rbClear, rbCollect], Integer(BinAction));
  79.   SizeEdit.Value := BinCapacity;
  80.   cbIcons.Checked := BinIcons;
  81.   cbDisable.Checked := BinDisable;
  82. end;
  83.  
  84. procedure TBinPropDlg.OKBtnClick(Sender: TObject);
  85. begin
  86.   BinCaption := CapEdit.Text;
  87.   BinAction := TBinAction(GetRadioIndex([rbLeave, rbDelete, rbClear, rbCollect]));
  88.   BinCapacity := SizeEdit.Value;
  89.   BinIcons := cbIcons.Checked;
  90.   BinDisable := cbDisable.Checked;
  91.   SaveBinProp;
  92.   Bin.Configure;
  93.   Bin.Visible := not BinDisable;
  94.   AnnounceSettingsChanged([scBin]);
  95. end;
  96.  
  97.  
  98.  
  99. end.
  100.