unit Webbrowser;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw, Buttons, ImgList, PngImageList,
ComCtrls, ToolWin, cxGraphics, cxControls, cxLookAndFeels,
cxLookAndFeelPainters, cxContainer, cxEdit, cxTextEdit, IdBaseComponent,
IdComponent, IdTCPConnection, IdTCPClient, IdEcho, winInet, SHDocVw_EWB,
EwbCore, EmbeddedWB, Menus, CategoryButtons;
type
TfrmMain =
class(TForm)
ToolBar1: TToolBar;
tbZurück: TToolButton;
tbRefresh: TToolButton;
tbVor: TToolButton;
ToolButton5: TToolButton;
PngImageList32x32: TPngImageList;
cxedtAdresse: TcxTextEdit;
Label1: TLabel;
tbVerbinden: TToolButton;
EmbeddedWB1: TEmbeddedWB;
tbTrennen: TToolButton;
ToolButton2: TToolButton;
tbOptionen: TToolButton;
PopupMenu1: TPopupMenu;
Optionen1: TMenuItem;
ber1: TMenuItem;
PngImageList16x16: TPngImageList;
procedure tbZurückClick(Sender: TObject);
procedure tbRefreshClick(Sender: TObject);
procedure tbVorClick(Sender: TObject);
procedure tbVerbindenClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure cxedtAdresseKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
procedure EmbeddedWB1CommandStateChange(ASender: TObject; Command: Integer;
Enable: WordBool);
procedure tbTrennenClick(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure Optionen1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
frmMain: TfrmMain;
implementation
uses Einstellungen;
{$R *.dfm}
procedure TfrmMain.tbZurückClick(Sender: TObject);
begin
EmbeddedWb1.GoBack;
end;
procedure TfrmMain.tbTrennenClick(Sender: TObject);
begin
EmbeddedWb1.Stop;
end;
procedure TfrmMain.cxedtAdresseKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
begin
if key = VK_RETURN
then
begin
EmbeddedWb1.Navigate(cxedtAdresse.Text);
tbZurück.Enabled := True;
tbVor.Enabled := True;
tbRefresh.Enabled := True;
tbTrennen.Enabled := True;
end;
end;
procedure TfrmMain.EmbeddedWB1CommandStateChange(ASender: TObject;
Command: Integer; Enable: WordBool);
begin
case Command
of
CSC_NAVIGATEBACK: tbZurück.Enabled := Enable;
CSC_NAVIGATEFORWARD: tbVor.Enabled := Enable;
end;
end;
procedure TfrmMain.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
EmbeddedWb1.Stop;
end;
procedure TfrmMain.FormShow(Sender: TObject);
begin
tbTrennen.Enabled := False;
end;
procedure TfrmMain.Optionen1Click(Sender: TObject);
begin
frmEinstellungen.Show;
end;
procedure TfrmMain.tbRefreshClick(Sender: TObject);
begin
EmbeddedWb1.Refresh;
end;
procedure TfrmMain.tbVorClick(Sender: TObject);
begin
EmbeddedWb1.GoForward;
end;
procedure TfrmMain.tbVerbindenClick(Sender: TObject);
begin
if cxedtAdresse.Text <> '
'
then
begin
EmbeddedWb1.Navigate(cxedtAdresse.Text);
tbTrennen.Enabled := True;
end
else
MessageDlg('
Du musst erst eine Internetadresse eintragen', mtInformation, [mbOK], 0, mbOk);
end;
end.