home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / mp3osr05.zip / src / sortopt.pas < prev    next >
Pascal/Delphi Source File  |  1999-12-22  |  1KB  |  74 lines

  1. (*
  2.  * part of MPEG searcher project
  3.  *  (c) 1999 by Alexander Trunov, 2:5069/10, jnc@mail.ru
  4.  *)
  5.  
  6. unit SortOpt;
  7.  
  8. interface
  9.  
  10. uses
  11.   Objects, Dialogs, Views, Drivers
  12.   {$IFDEF fpc}, Commands {$ENDIF}
  13.   ;
  14.  
  15. type
  16.   PSortOptions = ^TSortOptions;
  17.   TSortOptions = object(TDialog)
  18.     rdoOption: PRadioButtons;
  19.     constructor Init;
  20.     procedure GetData(var R); virtual;
  21.     procedure SetData(var R); virtual;
  22.     function DataSize: Longint; virtual;
  23.   end;
  24.  
  25. implementation
  26.  
  27. constructor TSortOptions.Init;
  28. var
  29.   R: TRect;
  30. begin
  31.   R.Assign(0, 0, 50, 13);
  32.   inherited Init(R, 'Sorting options');
  33.  
  34.   Options := Options or ofCentered;
  35.  
  36.   R.Assign(2, 1, 48, 2);
  37.   Insert(New(PStaticText, Init(R, ^C + 'Sort by:')));
  38.  
  39.   R.Assign(2, 3, 48, 9);
  40.   rdoOption := New(PRadioButtons, Init(R,
  41.     NewSItem('~p~ath + filename',
  42.     NewSItem('~f~ilename',
  43.     NewSItem('o~n~e item sort',
  44.     NewSItem('~t~wo items sort',
  45.     NewSItem('~r~andom', nil)))))));
  46.   Insert(rdoOption);
  47.  
  48.   R.Assign(36, 10, 48, 12);
  49.   Insert(New(PButton, Init(R, '~C~ancel', cmCancel, 0)));
  50.  
  51.   R.Assign(25, 10, 35, 12);
  52.   Insert(New(PButton, Init(R, 'S~o~rt', cmOk, bfDefault)));
  53.  
  54.   rdoOption^.Select;
  55.  
  56. end;
  57.  
  58. procedure TSortOptions.GetData(var R);
  59. begin
  60.   Integer(R) := rdoOption^.Sel;
  61. end;
  62.  
  63. procedure TSortOptions.SetData(var R);
  64. begin
  65.   rdoOption^.Press(Integer(R));
  66. end;
  67.  
  68. function TSortOptions.DataSize: Longint;
  69. begin
  70.   DataSize := SizeOf(Integer);
  71. end;
  72.  
  73. end.
  74.