Updated BPDemo with a working BFilePanel and a working BAlert

This commit is contained in:
ocoursiere
2004-01-11 18:00:04 +00:00
parent 66acd35741
commit c497837837
2 changed files with 50 additions and 7 deletions

View File

@@ -21,14 +21,44 @@ program Main;
{$M+}
uses
Application, Message, Roster, Rect, Window,
Main_Window;
Main_Window, SysUtils;
type
TMonApplication = class(BApplication)
public
procedure ReadyToRun; override;
function QuitRequested : Boolean; override;
procedure RefsReceived(amessage : BMessage); override;
procedure ArgvReceived(argc : integer; argv : PPChar); override;
procedure AboutRequested; override;
procedure Pulse; override;
procedure ReadyToRun; override;
end;
procedure TMonApplication.RefsReceived(amessage : BMessage);
begin
WriteLn('RefsReceived');
WriteLn('message.what : ' + IntToStr(amessage.what));
amessage.PrintToStream;
end;
procedure TMonApplication.ArgvReceived(argc : integer; argv : PPChar);
var
i : integer;
begin
WriteLn('Nb argument : ' + IntToStr(argc));
for i := 0 to argc - 1 do
WriteLn(argv[i]);
end;
procedure TMonApplication.AboutRequested;
begin
WriteLn('AboutRequested');
end;
procedure TMonApplication.Pulse;
begin
WriteLn('Pulse');
end;

View File

@@ -21,10 +21,10 @@ unit Main_Window;
interface
{$M+}
uses
SysUtils,
SysUtils, Application, AppDefs,
Alert, InterfaceDefs, ListItem, Menu, Menubar, Message, Rect, StringView,
TabView, View, Window,
Common, Button_View, Edit_View, Other_View;
Common, Button_View, Edit_View, Other_View, FilePanel,entry, messenger;
type
TMyWindow = class(BWindow)
@@ -150,6 +150,9 @@ var
S : String;
p : PChar;
Alert : BAlert;
FilePanel : BFilePanel;
aref : entry_ref;
aspecialmessage : BMessage;
begin
inherited;
case aMessage.what of
@@ -222,9 +225,19 @@ begin
VEdit.Edit.SetEnabled(false);
end;
MSG_MENU_BASE + 1 :
begin
aspecialmessage := BMessage.Create(17);
aspecialmessage.AddString('titititititi', 'titititititi');
FilePanel := BFilePanel.Create(B_OPEN_PANEL, be_app_BMessenger, aref, 0, true,
{aspecialmessage}nil,
nil, false, true);
FilePanel.Show;
end;
MSG_MENU_BASE + 2 :
begin
Quit;
be_app.PostMessage(B_QUIT_REQUESTED);
end;
end; // case