12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

480 Day 13<br />

List<strong>in</strong>g 13.1. cont<strong>in</strong>ued<br />

11: #<strong>in</strong>clude <br />

12: #<strong>in</strong>clude <br />

13: #<strong>in</strong>clude <br />

<strong>14</strong>: //----------------------------------------------------------------<br />

15: class TfmBrowser : public TForm<br />

16: {<br />

17: __published: // IDE-managed Components<br />

18: TTabControl *tcURL;<br />

19: TPanel *paHeader;<br />

20: TComboBox *cbURL;<br />

21: TBitBtn *bbGo;<br />

22: THTML *htBrowser;<br />

23: TBitBtn *bbHome;<br />

24: void __fastcall bbGoClick(TObject *Sender);<br />

25: void __fastcall htBrowserBeg<strong>in</strong>Retrieval(TObject *Sender);<br />

26: void __fastcall tcURLChange(TObject *Sender);<br />

27: void __fastcall bbHomeClick(TObject *Sender);<br />

28: void __fastcall htBrowserEndRetrieval(TObject *Sender);<br />

29: private: // User declarations<br />

30: public: // User declarations<br />

31: virtual __fastcall TfmBrowser(TComponent* Owner);<br />

32: };<br />

33: //----------------------------------------------------------------<br />

34: extern TfmBrowser *fmBrowser;<br />

35: //----------------------------------------------------------------<br />

36: #endif<br />

List<strong>in</strong>g 13.2. The <strong>C++</strong> source file of your Web browser’s ma<strong>in</strong> form,<br />

Surf00.<br />

1: //----------------------------------------------------------------<br />

2: #<strong>in</strong>clude <br />

3: #pragma hdrstop<br />

4:<br />

5: #<strong>in</strong>clude “Surf00.h”<br />

6: //----------------------------------------------------------------<br />

7: #pragma resource “*.dfm”<br />

8: TfmBrowser *fmBrowser;<br />

9: Str<strong>in</strong>g HomePage = “http://www.borland.com”;<br />

10:<br />

11: //----------------------------------------------------------------<br />

12: __fastcall TfmBrowser::TfmBrowser(TComponent* Owner)<br />

13: : TForm(Owner)<br />

<strong>14</strong>: {<br />

15: }<br />

16: //----------------------------------------------------------------<br />

17: void __fastcall TfmBrowser::bbGoClick(TObject *Sender)<br />

18: {<br />

19: htBrowser->RequestDoc(cbURL->Text);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!