Creating Chat Application with Borland Delphi/Indy: The Client
In this third article in a series on building a chat application, you will learn how to build the user interface, how to create code to deal with messages sent from the server, how to send a request to the server, and more.
Creating Chat Application with Borland Delphi/Indy: The Client - Building the User Interface (Page 2 of 5 )
First, let’s build the UI. Again, this is just a guide; please build the interface in any way you like. Fire up Delphi, create a new application, and drop an idtcpclient component. Rename it ‘tc’, and put 3 edits, 4 buttons,4 statictext, a listbox and a memo on the form. To create a menu on the form, you can use a mainmenu component. I’ve used a actionmainmenubar and action manager, because it gives an overall XP look. Now, double click on actionmanager or the mainmenu component (whichever one you’ve choosen), create a menu item called Configure, and add sub menu items, Connection Settings and Exit. Arrange them to your liking. This is what my UI looks like so far:
Add 3 more forms and call the associated units: sendfile, showpic and setup.
On the form that you will use to send a file add the following components:
edit rename to ‘edfn’
2 statictext,
2 buttons -- rename one of the buttons to btSendfile,
progressbar -- rename to 'prog'
an opendialogbox -- rename to 'op'
a combobox -- rename to 'cb.'
This is what my send file form looks like so far:
This is how you send a file
On the form that you will use to view screenshot add the following component:
Image – Available from the Additional Components Tab