File: UProperties.pas

package info (click to toggle)
tuxcmd 0.6.70%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, stretch
  • size: 3,612 kB
  • ctags: 2,757
  • sloc: pascal: 49,754; ansic: 2,272; makefile: 106
file content (144 lines) | stat: -rw-r--r-- 4,640 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
(*
    Tux Commander - UProeprties - File properties dialog
    Copyright (C) 2006 Tomas Bzatek <tbzatek@users.sourceforge.net>
    Check for updates on tuxcmd.sourceforge.net

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*)
unit UProperties;

interface

uses
  glib2, gtk2, pango, SysUtils, Types, Classes, Variants, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts, GTKView,
  GTKUtils, GTKDialogs, GTKPixbuf, GTKClasses, GTKMenus, 
  UCoreClasses, UGnome;

type
  TFProperties = class(TGTKDialog)
    TitleFrame, ListFontFrame: TGTKFrame;
    TitleLabel: TGTKLabel;
    TitleEventBox: TGTKEventBox;
    TitleIcon: TGTKImage;
    TitleHBox: TGTKHBox;
    Notebook: TGTKNotebook;
    BasicPage, PermissionsPage, OpenWithPage: TGTKVBox;
    
    Table2: TGTKTable;
    NameLabel: TGTKLabel;
    NameEdit: TGTKEntry;

    procedure FormCreate(Sender: TObject); override;
    procedure FormDestroy(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
  public
    DisplayFileName: string;
  end;

var
  FProperties: TFProperties;

implementation

uses ULocale, UFileAssoc, UCoreUtils, UConfig;


procedure TFProperties.FormCreate(Sender: TObject);
var i: integer;
begin
  SetDefaultSize(450, 500);
  Caption := Format('%s Properties', [DisplayFileName]);
  Buttons := [mbOK, mbCancel];
  ShowSeparator := False;
  TitleEventBox := TGTKEventBox.Create(Self);
  TitleLabel := TGTKLabel.Create(Self);
  TitleLabel.Caption := Format('<span size="x-large" weight="ultrabold">%s</span>', [Format('%s Properties', [DisplayFileName])]);
  TitleLabel.UseMarkup := True;
  TitleLabel.XAlign := 0;
  TitleLabel.XPadding := 0;
  TitleLabel.YPadding := 3;
  TitleEventBox.ControlState := csPrelight;
  TitleFrame := TGTKFrame.CreateWithoutLabel(Self);
  TitleFrame.ShadowType := stShadowOut;
  TitleIcon := TGTKImage.Create(Self);
  TitleIcon.SetFromStock('gtk-properties', isLargeToolbar);
  TitleHBox := TGTKHBox.Create(Self);
  TitleHBox.Homogeneous := False;
  TitleHBox.AddControlEx(TGTKVBox.Create(Self), False, False, 5);
  TitleHBox.AddControlEx(TitleIcon, False, False, 0);
  TitleHBox.AddControlEx(TitleLabel, True, True, 10);
  TitleEventBox.AddControl(TitleHBox);
  TitleFrame.AddControl(TitleEventBox);
  ClientArea.AddControlEx(TitleFrame, False, True, 0);

  Notebook := TGTKNotebook.Create(Self);
  Notebook.BorderWidth := 10;
  ClientArea.AddControlEx(Notebook, True, True, 0);

  BasicPage := TGTKVBox.Create(Notebook);
  Notebook.AppendPage(BasicPage, 'Basic');

  PermissionsPage := TGTKVBox.Create(Notebook);
  Notebook.AppendPage(PermissionsPage, 'Permissions');

  OpenWithPage := TGTKVBox.Create(Notebook);
  Notebook.AppendPage(OpenWithPage, 'Open With');


  // *********  PAGE Basic

  BasicPage.AddControlEx(TGTKVBox.Create(Self), False, False, 5);
  Table2 := TGTKTable.Create(Self);
  Table2.SetRowColCount(8, 5);
  BasicPage.AddControlEx(Table2, False, False, 0);

  NameLabel := TGTKLabel.Create(Self);
  NameLabel.Caption := Format('<span weight="ultrabold">%s</span>', ['_Name:']);
  NameLabel.XAlign := 0;
  NameLabel.UseMarkup := True;
  NameEdit := TGTKEntry.Create(Self);
  NameLabel.FocusControl := NameEdit;
  NameLabel.UseUnderline := True;
  Table2.AddControlEx(0, 0, 1, 1, NameLabel, [taoShrink, taoFill], [taoShrink], 2, 5);
  Table2.AddControlEx(1, 0, 1, 1, NameEdit, [taoShrink, taoFill], [taoShrink, taoExpand, taoFill], 2, 5);



  // *********  PAGE Permissions



  // *********  PAGE Applications


  // ******************

  OnKeyDown := FormKeyDown;
  OnDestroy := FormDestroy;
end;

procedure TFProperties.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean);
begin
  if Key = GDK_ESCAPE then ModalResult := mbCancel;
end;

procedure TFProperties.FormDestroy(Sender: TObject);
begin

end;

(********************************************************************************************************************************)
end.