Description: Main window of StyxTorrent is created through template – “Dialog Based MFC Application”. Its Border is a “Dialog Frame” with “Popup” Style. Resizing of main window is disable hence it is a fixed size window.
The class which manage initialization draw/redraw and additional Bittorrent protocol implementation functions is CTabDialogDlg. And the class responsible for invoking Main Window is CTabDialogApp, which set the main window type as “Modal”.
Description: This window appears when user selects option “Grid” from menu option List View inside main menu Settings.
Type: Modal Dialog Box (CDialog)
Description: This dialog box is standalone part of StyxTorrent application which means it doesn’t transfer any kind of data with Main Window or its child window. It is invoked when user clicks on “Create” option on “File” menu or “Create Torrent” button on toolbar. Its only function is to create a torrent file using of selected content with specified name in “Save As” text box.
To create a torrent file two fields are mandatory (unless it is private torrent) - .
Select Content through Add File or Add Folder.
File Name
If user selects the “Private Torrent” then trackers field will become mandatory as well (which requires a tracker made from user IP).“Piece length” and “Comment” options can be left unchanged; they will be managed by application.
The “Select Content” edit box and “File Name” edit box are disabled. They are supposed to be filled with support buttons so that there won’t be conflict with content path or name of torrent file and to avoid over writing of existing torrent file at selected location as well.
Once the user clicks “Create” button, application performs validation over all the fields from top to bottom and prints the error/notification message for corresponding field. Once all the fields pass the validation check successfully torrent file is created.
Type: Modal Dialog Box (CDialog)
Description: Although this dialog box is also standalone part of StyxTorrent, it does transfer data under certain condition and it also manages a necessary data file “StyxTorrentSettings.dat”. The primary use of this dialog box is to get user specific settings to store it on local disk and every time the “Main Window” is executed the data file is read first (only if it exists).
After installing StyxTorrent on a machine the class CTabDialogDlg creates new “StyxTorrentSettings.dat” with default values set in it. Preferences dialog box will appear if user selects “Preferences” Option from “Settings” menu or press on “Preferences” button on toolbar.
Considering that this is the first time user has invoked this dialog box, the text boxes will display default values. If user change few fields and press “OK” button the application will validate all fields (for empty fields) and once the fields pass validation the new settings will be written to “StyxTorrentSettings.dat”. The new settings will only be applied after application restarts.
Type: List Control (CListCtrl,)
Description: List Control is one of three components displayed inside client are of “Main Window”. Its style is “Report”, which means it will be treated as table with headers, columns, rows, header separators.
The main purpose of List Control is to display list of torrents included in application (excluding the one those were “Deleted” or .torrent misplaced on local disk) with 9 attributes –
1. Name of Torrent
2. Size of Torrent
3. Completed bytes of Torrent
4. Remaining byes of Torrent
5. Current Download Rate
6. Current Upload Rate
7. Current Status of Torrent
A. “Queued for Checking”
B. “Checking Files”
C. “Downloading Metadata”
D. “Downloading”
E. “Finished”
F. “Seeding”
G. “Allocating”
H. “Checking Resume Data”
I. “Unspecified”
8. Hash string of Torrent(Hidden)
9. Share history of the torrent
A. “Zero” ( Share ratio b/w 0 & 0.1)
B. “Low” ( Share ratio b/w 0.1 & 0.999)
C. “Average” ( Share ratio b/w 0.999 & 4.999)
D. “High” ( Share ratio b/w 4.999 & 19.999)
E. “TERRIFIC” ( Share ratio above 19.999)
The 8th field is hidden because it is primary used by application to check whether the new torrent user is trying to open exist in list already or not. User can drag the left resize bar to “share” column towards right to view hash column.
The list control updates after every 2.5 seconds, although some data might pass through update interval but possibility is very low.
List Control populates as new torrents are added and it becomes empty when user press “Delete” button on toolbar.
Type: Tab Control (CTabCtrl)
Description: There are two kind of tab controls : one which has a tab with multiple pages (CPropertyPages) and other one has tab with multiple dialogs (CTabCtrl). IDC_TAB1 is of second type, it posses 3 child dialog boxes (IDD_DIALOG1, IDD_DIALOG2, IDD_DIALOG3) with “None” type border and “Main Window” is parent to it. The only limitation with IDC_TAB1 is that you will need a pointer to parent every time you want to do some action on any of 3 tabs , which can be obtained from class CTabDialogDlg. But CTabCtrl provides more flexibility against CPropertyPages.
In StyxTorrent CTabCtrl is painted on client are with 3 tabs in it –
Info Tab (Displays static information of last added torrent).
Trackers Tab (Displays list of trackers associated with the last added torrent).
Files (Displays list of Files to be downloaded for last added torrent).
Type: Modeless Dialog with no border under Tab Control (IDC_ TAB1)
Description: It is child to tab control which displays 2 more dialogs under it just like this one. The information printed on IDD_DIALOG1 is static but content are selectable. Following are list of field’s displayed for last added torrent -
Name of Torrent
Size of Torrent
Piece length/Size of Torrent
Number of pieces (size/piece length)
Comment (“NONE” if .torrent file metadata shows this field as empty)
Created By (“StyxTorrent” if .torrent was created in StyxTorrent)
Hash of Torrent in Hexadecimal
Although the values of above fields will be displayed in text box, user cannot modify their value because all text boxes are disabled
Type: Modeless Dialog with no border under Tab Control (IDC_ TAB1)
Description: Trackers tab is 2nd dialog displayed in tab control. It contains one control ie ListBox , which further contains list of tracker in last added torrent. There are no columns in ListBox and niether displays tracker less connectivity methods in it but that doesn't mean StyxTorrent doesn't support tracker less torrents.
The typical format of tracker is -
(protocol):\(Host):(port)\announce
protocol-udp,http etc
Host - URL to the tracker server
Port - virtual open in tracker server
announce - keyword
The list of tracker in list box is cleared when user press "Delete" button on toolbar .
Type: Modeless Dialog with no border under Tab Control (IDC_ TAB1)
Description: Just like other two tabbed-dialogs under tab control , this dialogbox also display static text/data of last added torrent in session. This Dialog contains a ListBox with no header and no column, its purpose is to display the list of files to be downloaded with the torrent from swarm.
The list box display file in following format-
(parent directory-if any)(file name).(extension)
The horizontal and vertical scroll bar will be enabled only if the content doesn't fit vertically or horizonatally. Selection can also be made on a particular listbox item. ListBox items will be cleared if user presses "Delete" button from toolbar.
Description: Toolbar in StyxTorrent is on top of client area. It contains 11 Buttons divided in 4 sections. The main purpose of toolbar is to provide shortcut to user for performing certain operations. Currently StyxTorrent toolbar don't provide torrent specific operation which means all the buttons on the toolbar are universal and they don't have tooltips either so user have to guess from figure to find what a toolbar button does.
Buttons with their tasks-
1. Open Buttton - Same task as "Open" option from File menu
2. Create Buttton - Same task as "Create" option from File menu
3. Delete Buttton - Removes all the torrents included in session , clears the list control and truncate the .StyxTorrentResumeFile for each torrent included to zero. But keeps the downloaded content in download directory.
4. Start Buttton - Performable only if Torrents are "Paused" or "Stopped". If performable its only task is to resume all torrents in session. If the torrents were "Stopped" ,"Start" resumes session as well as torrents in session. If the torrents were "Paused" , "Start" resumes the torrents only. Once the action is completed the "Start" button is disabled and "Pause" & "Stop" buttons are enabled.
5. Stop Buttton - Performable under any condition if there are atleast one torrent in session/list. Its main task to "Pause" all torrents and session. The other task it perform is to update ".StyxTorrentResumeFile" and "StyxTorrentTorrentList.dat" files. Once the action is completed the "Pause" and "Stop" buttons are disabled.
6. Pause Buttton - Performable only if Torrents were paused and there is atleast ont torrent in session/list. It pause all the torrents in the session . Once the task is done successfully the "Pause" button is disabled and "Start" button is enabled.
7. Priority Buttons - All four buttons don't have any significant role in StyxTorrent although positive results were found while testing application. They can increase or decrease priority of last added torrent ie decrease by one or increase by one or assign topmost priority or bottom most priority.
8. Preferences Button - Same as "Preferences" option from the Settings Menu.