Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 3 - Creating an RSS Reader
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Creating an RSS Reader
By: Jacques Noah
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2006-08-16

    Table of Contents:
  • Creating an RSS Reader
  • Code
  • Web Browser Code
  • Navigation Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating an RSS Reader - Web Browser Code


    (Page 3 of 4 )

    Click on the TWebBrowser component, go to the object inspectors event tab, double click on the CommandStateChange event and add the following code:

    procedure TForm1.wbCommandStateChange(Sender: TObject; Command:
    Integer;
    Enable: WordBool);
    begin

    case Command of CSC_UPDATECOMMANDS :
    begin
    wbRefresh.Enabled := not wb.Busy;
    end;

    CSC_NAVIGATEFORWARD :
    begin
    navforward.Enabled := Enable;
    end;

    CSC_NAVIGATEBACK :
    begin
    navback.Enabled := Enable;
    end;

    end;
    end;

    The code above enables and disables the browser-related buttons depending on what state the browser is in.

    In the object inspector, double click on the OnDocumentComplete event and add the following code:

    procedure TForm1.wbDocumentComplete(Sender: TObject;
    const pDisp: IDispatch; var URL: OleVariant);
    begin
    wbRefresh.Enabled := true;
    end;

    This procedure just enables the refresh button once the browser has completed downloading a web page.

    Next, double click on the OnNewWindow2 event and add the following code:

    procedure TForm1.wbNewWindow2(Sender: TObject; var ppDisp: IDispatch;
    var Cancel: WordBool);
    var
    NewWindow : TForm1;
    begin
    NewWindow := TForm1.Create(self);
    with NewWindow do begin
    ppDisp := wb.Application;
    show;
    end;
    end;

    This procedure ensures that any link that you click on opens up a web page in the TWebBrowser component, and not in the default browser of the system.

    Next, double click on the OnStatusTextChange event and add the following code:

    procedure TForm1.wbStatusTextChange(Sender: TObject; const Text: WideString);
    begin
    StatusBar1.SimpleText := Text;
    end;

    The code adds browser status text to the Statusbar. For example, if the browser loads a new document, a message stating that action will be displayed in the status bar.

    More Delphi-Kylix Articles
    More By Jacques Noah


     

    DELPHI-KYLIX ARTICLES

    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...
    - Using the Client Dataset in Two-Tiered Clien...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT