Author: jerome
Date: 2009-05-29 12:26:44 +0200 (Fri, 29 May 2009)
New Revision: 4701

Added:
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.cfg
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dof
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dpr
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.res
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dcu
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas
Log:
* Added first shot of web browser ( without server part ).

Added: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.cfg
===================================================================
--- 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.cfg
                              (rev 0)
+++ 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.cfg
      2009-05-29 10:26:44 UTC (rev 4701)
@@ -0,0 +1,35 @@
+-$A8
+-$B-
+-$C+
+-$D+
+-$E-
+-$F-
+-$G+
+-$H+
+-$I+
+-$J-
+-$K-
+-$L+
+-$M-
+-$N+
+-$O+
+-$P+
+-$Q-
+-$R-
+-$S-
+-$T-
+-$U-
+-$V+
+-$W-
+-$X+
+-$YD
+-$Z1
+-cg
+-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+-H+
+-W+
+-M
+-$M16384,1048576
+-K$00400000
+-LE"c:\program files\borland\delphi6\Projects\Bpl"
+-LN"c:\program files\borland\delphi6\Projects\Bpl"

Added: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dof
===================================================================
--- 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dof
                              (rev 0)
+++ 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dof
      2009-05-29 10:26:44 UTC (rev 4701)
@@ -0,0 +1,83 @@
+[FileVersion]
+Version=6.0
+[Compiler]
+A=8
+B=0
+C=1
+D=1
+E=0
+F=0
+G=1
+H=1
+I=1
+J=0
+K=0
+L=1
+M=0
+N=1
+O=1
+P=1
+Q=0
+R=0
+S=0
+T=0
+U=0
+V=1
+W=0
+X=1
+Y=1
+Z=1
+ShowHints=1
+ShowWarnings=1
+UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+[Linker]
+MapFile=0
+OutputObjs=0
+ConsoleApp=1
+DebugInfo=0
+RemoteSymbols=0
+MinStackSize=16384
+MaxStackSize=1048576
+ImageBase=4194304
+ExeDescription=
+[Directories]
+OutputDir=
+UnitOutputDir=
+PackageDLLOutputDir=
+PackageDCPOutputDir=
+SearchPath=
+Packages=
+Conditionals=
+DebugSourceDirs=
+UsePackages=0
+[Parameters]
+RunParams=
+HostApplication=
+Launcher=
+UseLauncher=0
+DebugCWD=
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=

Added: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dpr
===================================================================
--- 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dpr
                              (rev 0)
+++ 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dpr
      2009-05-29 10:26:44 UTC (rev 4701)
@@ -0,0 +1,14 @@
+program Project2;
+
+uses
+  Forms,
+  Unit1 in 'Unit1.pas' {Form1};
+
+{$R *.res}
+
+begin
+  Application.Initialize;
+  Application.ShowMainForm:=False;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.

Added: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.res
===================================================================
(Binary files differ)


Property changes on: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.res
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dcu
===================================================================
(Binary files differ)


Property changes on: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dcu
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm
===================================================================
--- 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm
                         (rev 0)
+++ 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm
 2009-05-29 10:26:44 UTC (rev 4701)
@@ -0,0 +1,64 @@
+object Form1: TForm1
+  Left = 291
+  Top = 127
+  Width = 963
+  Height = 634
+  Caption = 'Tux Droid Browser'
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  OnCloseQuery = FormCloseQuery
+  OnCreate = FormCreate
+  PixelsPerInch = 96
+  TextHeight = 13
+  object EmbeddedWB1: TEmbeddedWB
+    Left = 0
+    Top = 0
+    Width = 955
+    Height = 600
+    Align = alClient
+    TabOrder = 0
+    DisableCtrlShortcuts = 'N'
+    UserInterfaceOptions = [EnablesFormsAutoComplete, EnableThemes]
+    DisabledPopupMenus = [rcmAll]
+    About = ' EmbeddedWB http://bsalsa.com/'
+    DisabledPopupMenuItems = [rcsOpenNWindow, rcsOpenLink]
+    PrintOptions.HTMLHeader.Strings = (
+      '<HTML></HTML>')
+    PrintOptions.Orientation = poPortrait
+    ControlData = {
+      4C0000009D530000553200000000000000000000000000000000000000000000
+      000000004C000000000000000000000001000000E0D057007335CF11AE690800
+      2B2E126208000000000000004C0000000114020000000000C000000000000046
+      8000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000100000000000000000000000000000000000000}
+  end
+  object PopupMenu1: TPopupMenu
+    OnPopup = PopupMenu1Popup
+    Left = 112
+    Top = 168
+    object ShowHide1: TMenuItem
+      Caption = 'Show/Hide'
+      OnClick = ShowHide1Click
+    end
+    object Mute1: TMenuItem
+      Caption = 'Mute'
+      OnClick = Mute1Click
+    end
+    object Help1: TMenuItem
+      Caption = 'Help'
+      OnClick = Help1Click
+    end
+    object N1: TMenuItem
+      Caption = '-'
+    end
+    object Quit1: TMenuItem
+      Caption = 'Quit'
+      OnClick = Quit1Click
+    end
+  end
+end

Added: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas
===================================================================
--- 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas
                         (rev 0)
+++ 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas
 2009-05-29 10:26:44 UTC (rev 4701)
@@ -0,0 +1,215 @@
+{* This file is part of "Tux Droid Browser".
+ *    Copyright 2009, kysoh
+ *    Author : Conan Jerome.
+ *    eMail  : [email protected]
+ *    Site   : http://www.kysoh.com/
+ *
+ * "Tux Droid Browser" 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * "Tux Droid Browser" 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 "Tux Droid Browser"; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *}
+
+
+unit Unit1;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, OleCtrls, SHDocVw_EWB, EwbCore, EmbeddedWB, ShellAPI, Menus, 
Registry;
+
+const wm_AppelMessage = wm_user + 1;
+
+type
+  TForm1 = class(TForm)
+    EmbeddedWB1: TEmbeddedWB;
+    PopupMenu1: TPopupMenu;
+    ShowHide1: TMenuItem;
+    Mute1: TMenuItem;
+    Help1: TMenuItem;
+    N1: TMenuItem;
+    Quit1: TMenuItem;
+
+    procedure FormCreate(Sender: TObject);
+    procedure PopupMenu1Popup(Sender: TObject);
+    procedure ShowHide1Click(Sender: TObject);
+    procedure Quit1Click(Sender: TObject);
+    procedure Help1Click(Sender: TObject);
+    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+    procedure Mute1Click(Sender: TObject);
+
+  private
+    { D�clarations priv�es }
+    procedure WMAppelMessage(var msg : TMessage); message wm_AppelMessage;
+    function OpenUrl(const url : String) : boolean;
+
+  public
+    { D�clarations publiques }
+  end;
+
+var
+  Form1 : TForm1;
+  Tray  : TNotifyIconData;
+
+
+implementation
+
+{$R *.dfm}
+
+{###############################################}
+{####### Form1 properties and events      ######}
+{###############################################}
+
+
+//Form initialization.
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+
+  //Tray icon initialization.
+  Tray.cbSize := SizeOf(Tray);
+  Tray.wnd := Handle;
+  Tray.uID := 1;
+  Tray.UCallbackMessage := wm_AppelMessage;
+
+  //Set icon and text.
+  Tray.hIcon := Application.Icon.handle;
+  Tray.szTip := 'Show/Hide Tux Droid Browser';
+  Tray.uFlags := nif_message or nif_icon or nif_tip;
+
+  //Adding tray icon to the system tray.
+  Shell_NotifyIcon(Nim_ADD,@Tray);
+
+  //Embedded browser initialization.
+  EmbeddedWB1.Go('http://127.0.0.1:270/devel/');
+end;
+
+
+//Avoiding close action.
+procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+begin
+  CanClose := False;
+  Form1.Hide;
+end;
+
+
+{###############################################}
+{####### Tray icon properties and events  ######}
+{###############################################}
+
+//Actions to do when popup menu is showed.
+procedure TForm1.PopupMenu1Popup(Sender: TObject);
+begin
+  if Form1.Visible then
+    ShowHide1.Caption := 'Hide'
+  else
+    ShowHide1.Caption := 'Show';
+end;
+
+
+//Tray menu show/hide click.
+procedure TForm1.ShowHide1Click(Sender: TObject);
+begin
+  if Form1.Visible then
+    Form1.Hide
+  else
+    Form1.Show;
+end;
+
+
+//Tray icon 'help' click.
+procedure TForm1.Help1Click(Sender: TObject);
+begin
+  if not Form1.OpenUrl('http://www.kysoh.com/documentation/') then
+    dialogs.ShowMessage('Error while loading help');
+end;
+
+
+//Tray icon 'mute' click.
+procedure TForm1.Mute1Click(Sender: TObject);
+begin
+{TODO}
+end;
+
+
+//Tray menu 'quit' click.
+procedure TForm1.Quit1Click(Sender: TObject);
+begin
+  Shell_NotifyIcon(Nim_DELETE,@tray);
+  Application.Terminate;
+end;
+
+
+{###############################################}
+{####### Private functions and procedures ######}
+{###############################################}
+
+//Open an url into the default web browser.
+function TForm1.OpenUrl(const url : String) : boolean;
+var
+   Browser: string;
+begin
+   Browser := '';
+
+   with TRegistry.Create do
+     try
+       RootKey := HKEY_CLASSES_ROOT;
+       Access := KEY_QUERY_VALUE;
+       if OpenKey('\htmlfile\shell\open\command', False) then
+         Browser := ReadString('') ;
+       CloseKey;
+     finally
+       Free;
+   end;
+
+   if Browser = '' then
+   begin
+     Exit;
+     Result := False;
+   end;
+
+   Browser := Copy(Browser, Pos('"', Browser) + 1, Length(Browser)) ;
+   Browser := Copy(Browser, 1, Pos('"', Browser) - 1) ;
+   ShellExecute(0, 'open', PChar(Browser), PChar(URL), nil, SW_SHOW) ;
+
+   Result := True;
+end;
+
+
+//Tray icon click event.
+procedure TForm1.WMAppelMessage(var msg : TMessage);
+var
+  Cursor : TPoint;
+begin
+
+  //Clique droit de la souris
+  if msg.LParam = Wm_LButtonDown then
+  begin
+    //Showing application.
+    if Form1.Visible then
+      Form1.Hide
+    else
+      Form1.Show;
+  end
+  else if msg.LParam = Wm_RButtonDown then
+  begin
+    SetForegroundWindow(Handle);
+    GetCursorPos(Cursor);
+    PopupMenu1.Popup(Cursor.X, Cursor.Y);
+    PostMessage(Handle, WM_NULL, 0, 0);
+  end;
+
+end;
+
+end.
+


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to