1 / 24

VB6.0

New Interaction Techniques. VB6.0. VB6.0. Software writing for NIT & usability testing. Grigori Evreinov. Department of Computer Sciences University of Tampere, Finland. Department of Computer Sciences University of Tampere, Finland. www.cs.uta.fi/~grse/. September – December, 2003.

kamuzu
Télécharger la présentation

VB6.0

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. New Interaction Techniques VB6.0 VB6.0 Software writing for NIT & usability testing Grigori Evreinov Department of Computer SciencesUniversity of Tampere, Finland Department of Computer SciencesUniversity of Tampere, Finland www.cs.uta.fi/~grse/ September – December, 2003

  2. Software writing for NIT Visual Basic Objects (Controls) TextBox Label Frame CommandButton CheckBox Shape Image PictureBox MSFlexGrid Timer Menu and their general properties Top, Left, Height, Width ScaleMode ScaleTop, ScaleLeft ScaleHeight, ScaleWidth Enabled, Visible, Locked Index (array of objects), TabIndex Appearance, BackColor, BorderStyle Font, ForeColor, Alignment ToolTipText, MousePointer other properties KeyPreview (Form) MultiLine, ScrollBars, Text Caption, AutoSize, WordWrap, BackStyle Cancel (btn) Value Picture, Icon (Form) AutoRedraw (Form & PicB) Rows, Cols Interval TAUCHI MMIG G. Evreinov p 01_23 23.09.2003

  3. Software writing for NIT and their event procedures* Click, DblClick, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp GotFocus, LostFocus Shape has no event procedures Timer Load, Activate, Initialize, Unload, Resize, Terminate Objects (Controls) TextBox Label Frame CommandButton CheckBox Shape Image PictureBox MSFlexGrid Timer Menu * a procedure is a block of code that performs some operation: Public (is available to all modules), Private (in the current module or form) TAUCHI MMIG G. Evreinov p 02_23 23.09.2003

  4. Software writing for NIT Variables and data types Boolean 2 bytes (storage size)True or False Integer (%) 2 bytes -32,768 to 32,767 (256 x 256=65536) Long (& long integer) 4 bytes -2147483648 to +2147483647 (65536 x 65536=4294967296) Single (! single-precision) 4 bytes -3.402823E38 to -1.401298E-45 for “-” values; 1.401298E-45 to 3.402823E38 for “+” values. Double (# double-precision) 8 bytes -1.79769313486232E308 to -4.94065645841247E-324 for “-” values; 4.94065645841247E-324 to 1.79769313486232E308 for “+” values. String ($ fixed-length) Length of string in bytes 1 to approximately 65,400 “…” Variant(by default!) 16 bytes Any numeric value up to the range of a Double. Byte 1 byte 0 to 255 TAUCHI MMIG G. Evreinov p 03_23 23.09.2003

  5. Software writing for NIT other Variables and data types String(variable-length) 10 bytes + string length 0 to approximately 2 billion characters (2Hb) Variant(with characters) 22 bytes + string length Same range as for variable-length String. Currency (@ scaled integer) 8 bytes -922,337,203,685,477.5808 to 922,337,203,685,477.5807 Date 8 bytes January 1, 100 to December 31, 9999 Object 4 bytes Any Object reference User-defined(using Type) Depends upon what elements are used The range of each element is the same as the range of its data type. TAUCHI MMIG G. Evreinov p 04_23 23.09.2003

  6. Variant Dim a, b, c As Integer Variant Software writing for NIT • Declaration and converting functions* • Dim str1 As Integer, cl1 As Integer • Dim Xtmp As Integer • Dim X As Single • Dim nChar As Integer • Dim CtrlMsk As Boolean • Dim ArrWords(19) As String • Dim LastFile As String, FileName As String • CInt, CLng, CBool, CDate, CStr • Xtmp = Cint(X) to declare constant Const PI = 3.14159265 Const SND_LOOP = &H8 to declare function Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long *http://www.juicystudio.com/tutorial/vb/variables.html TAUCHI MMIG G. Evreinov p 05_23 23.09.2003

  7. Software writing for NIT Objects (Controls) Form, PictureBox TextBox, Label, Frame CommandButton CheckBox Shape Image MSFlexGrid, ListBox supports the following methods* Cls, Circle, Line, Pset, PaintPicture, PopupMenu, Hide Refresh, ZOrder, Move, Drag, SetFocus AddItem, Clear * a built-in procedure that performs an operation on a specific control or methods are actions that objects can perform TAUCHI MMIG G. Evreinov p 06_23 23.09.2003

  8. Software writing for NIT File System Object Methods CopyFile Used to copy an existing file. CopyFolder Used to copy an existing folder. CreateFolder Used to create a folder. CreateTextFile Used to create a text file. DeleteFile Used to delete a file. DeleteFolder Used to delete a folder. DriveExists Used to determine whether a drive exists. FileExists Used to determine whether a file exists. FolderExists Used to determine whether a folder exists. GetAbsolutePathName Used to return the full path name. GetDrive Used to return a specified drive. GetDriveName Used to return the drive name. GetFile Used to return a specified file. GetFileName Used to return the file name. GetFolder Used to return a specified folder. GetParentFolderName Used to return the name of the parent folder. GetTempName Used to create and return a string representing a file name. MoveFile Used to move a file. MoveFolder Used to move a folder. OpenTextFile Used to open an existing text file. Common Dialog Box Methods ShowColor Used to display the Color dialog box. ShowFont Used to display a list of fonts ShowHelp Used to display a Windows Help File ShowOpen Used to display the dialog to open files ShowPrinter Used to display the dialog to open files ShowSave similar to the ShowOpen method TAUCHI MMIG G. Evreinov p 07_23 23.09.2003

  9. Software writing for NIT Functions, most frequently used Abs(number) ‘b = Abs(-50) b = 50 Asc(string) ‘b = Asc(“Apple”) b = 65 Dir(pathname,[ attributes]) returns the name of a file, directory, or folder that matches a specified pattern or file attribute FileName = App.Path & “\TWords.txt” strFile =Dir(FileName) If strFile <> “” Then… Error [(errornumber)] Integer that represents an error number Debug.PrintError(ErrorNumber) Hex (number) i = Hex(459) ‘= 1CB Rnd[(number)] returns a random number (0-1) before callingRnd, use the Randomize statement without an argument to initialize the random-number generator based on the system timer. to produce random integers in a given range, use this formula: Int((upperbound - lowerbound + 1) * Rnd + lowerbound) here, upperbound is the highest number in the range, and lowerbound is the lowest number in the range. TAUCHI MMIG G. Evreinov p 08_23 23.09.2003

  10. Software writing for NIT Functions, most frequently used LoadPicture([stringexpression]) returns a picture object (by Commdlg or “….bmp”) imgImage.Picture = LoadPicture() Str(number)may be used to convert a non-String data type to a String data type bString = Str(-459.65) ‘ returns “-459.65” backward Val(string) InStr ([start, ]string1, string2[, compare]) returns the position of the first occurrence of one string within another Left(string, length) returns a specified number of characters from the left side of a string Len(string | varname) returns the number of chars in a string or the number of bytes required to store a variable LTrim(string), RTrim(string), Trim(string) return a copy of a string without: leading spaces (LTrim), trailing spaces (RTrim), or both (Trim). Mid(string, start[, length]) returns a specified number of chars from a string Right(string, length) returns a specified number of chars from the right side of a string StrComp(string1, string2[, compare]) performs a binary or textual comparison [ http://www.juicystudio.com/tutorial/vb/strings.html ] TAUCHI MMIG G. Evreinov p 09_23 23.09.2003

  11. Software writing for NIT Functions, most frequently used Sqr(number) returns the square root of a number Time returns a Variant of subtype Date indicating the current system time Timer returns the number of sec that have elapsed since 12:00AM (midnight) GetTickCountretrieves the number of milliseconds that have elapsed since 12:00AM (midnight) or have elapsed since Windows CE was started MsgBox(prompt[, buttons*] [, title] [, helpfile, context]) displays a message in a dialog box, waits for the user to click a button, and returns a value indicating which button the user clicked MsgBox “Error of opening” & FileName MsgBox “Input's error”, , “SmartStick” * (0–5) describes the number and type of buttons displayed in the dialog box; 1 – OK, 2 – Cancel, 3 – Abort, 4 – Retry, 5 – Ignore, 6 – Yes, 7 - No (16, 32, 48, 64) describes the icon style; (0, 256, 512, 768) determines which button is the default TAUCHI MMIG G. Evreinov p 10_23 23.09.2003

  12. Software writing for NIT Operators & Statements, most frequently used [Call] name [argumentlist] Call - optional keyword; name of the procedure to call; argumentlist - optional. Comma-delimited list of variables, arrays, or expressions to pass to the procedure. Call PrintToDebugWindow ("Hello World") PrintToDebugWindow "Hello World" [Public | Private] Const constname [As type] = expression declares constants [Public | Private] Declare Sub name Lib "libname" [Alias "aliasname"] [([arglist])] or [Public | Private] Declare Function name Lib "libname" _[Alias "aliasname"] [([arglist])] [As type] used at the module level to declare references to external procedures in a dynamic-link library (DLL) Public Declare Function sndPlaySound Lib “winmm.dll” Alias “sndPlaySoundA” _ (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long [ http://msdn.microsoft.com/library/en-us/vblr7/html/vastmConst.asp http://msdn.microsoft.com/library/en-us/vblr7/html/vastmCall.asp http://msdn.microsoft.com/library/en-us/vblr7/html/vastmDeclare.asp] TAUCHI MMIG G. Evreinov p 11_23 23.09.2003

  13. Software writing for NIT Operators & Statements, most frequently used Dim varname[([subscripts])][, varname[([subscripts])]] . . . used at module, class, structure, procedure, or block level to declare and allocate storage space for variables varname - name of the variable, follows standard variable naming conventions subscripts - dimensions of an array variable ReDim [Preserve] varname(subscripts) [, varname(subscripts)] . . . used at procedure level to reallocate storage space for an array variable Do…Loop repeats a block of statements while a Boolean condition is True or until the condition becomes True For…Next repeats a group of statements a specified number of times And, Or, Not [ http://msdn.microsoft.com/library/en-us/vblr7/html/vastmDim.asp http://msdn.microsoft.com/library/en-us/vblr7/html/vastmReDim.asp http://msdn.microsoft.com/library/en-us/vblr7/html/vastmDo.asp http://msdn.microsoft.com/library/en-us/vblr7/html/vastmFor.asp] TAUCHI MMIG G. Evreinov p 12_23 23.09.2003

  14. Software writing for NIT • Operators & Statements, most frequently used • End terminates execution immediately • Exit { Do | For | Function | Property | Select | Sub | Try | While } • exits a procedure or block and transfers control immediately to the • statement following the procedure call or the block definition • Sub ExitStatementDemo() • Dim I, iNum As Integer • Do ' Set up infinite loop. • For I = 1 To 1000 ' Loop 1000 times. • iNum = Int(Rnd * 1000) ' Generate random numbers. • Select Case iNum ' Evaluate random number. • Case 7: Exit For ' If 7, exit For...Next. • Case 29: Exit Do ' If 29, exit Do...Loop. • Case 54: Exit Sub ' If 54, exit Sub procedure. • End Select • Next I • Loop • End Sub • Close [number] to close the file (number) opened with the help of Open • Load / Unload object • [ http://msdn.microsoft.com/library/en-us/vblr7/html/vastmExit.asp • http://msdn.microsoft.com/library/en-us/vblr7/html/vastmEnd.asp] EndEnd Function End IfEnd Property End SelectEnd SubEnd TypeEnd With Exit DoExit ForExit FunctionExit PropertyExit Sub TAUCHI MMIG G. Evreinov p 13_23 23.09.2003

  15. Software writing for NIT Usability-testing software for… TAUCHI MMIG G. Evreinov p 14_23 23.09.2003

  16. Timer2 Timer1 Software writing for NIT txtPersonData comments… TWords.txt /phrases GridData1: test words/chars entered text /chars time per char, ms fraData WordsLoading lblSave_Click() Test initialization SetTest lblOpen_Click() lblTestSymbol GridData1_Click() to save column SetData txtText1 GridData2: char per word /phrase num. of entered words num. of strokes /clicks per word /phrase time per word/phrase, s Statistics() Rtime, ms s (st.dev), ms Errors wpm TestTime, s Ctrl+K=>move keys SetSigns On-screen Keyboard SetCharacters BackSp Trial start GridData2_Click() to save column Break test Clear Data TAUCHI MMIG G. Evreinov p 15_23 23.09.2003

  17. Software writing for NIT Lesson1 txtPersonData comments… TWords.txt /phrases GridData1: test words/chars entered text /chars time per char, ms fraData WordsLoading lblTestSymbol txtText1 On-screen Keyboard TAUCHI MMIG G. Evreinov p 16_23 23.09.2003

  18. Software writing for NIT Lesson2 txtPersonData comments… TWords.txt /phrases GridData1: test words/chars entered text /chars time per char, ms fraData WordsLoading lblTestSymbol GridData1_Click() to save column txtText1 GridData2: char per word /phrase num. of entered words num. of strokes /clicks per word /phrase time per word/phrase, s On-screen Keyboard GridData2_Click() to save column TAUCHI MMIG G. Evreinov p 17_23 23.09.2003

  19. Software writing for NIT Lesson3 txtPersonData comments… TWords.txt /phrases GridData1: test words/chars entered text /chars time per char, ms fraData WordsLoading lblSave_Click() lblOpen_Click() lblTestSymbol GridData1_Click() to save column txtText1 GridData2: char per word /phrase num. of entered words num. of strokes /clicks per word /phrase time per word/phrase, s SetSigns On-screen Keyboard SetCharacters BackSp GridData2_Click() to save column Clear Data TAUCHI MMIG G. Evreinov p 18_23 23.09.2003

  20. Software writing for NIT Lesson3 Text <> “” Private Sub BackSp() No return into the TextBox play wave “Empty” * A sample of imaging for algorithm or procedure, description should be done in a separate paragraph Yes define the Length of the Text Exit the last Char = Linefeed Yes remove two last chars in the TextBox put cursor at the end of the text play wave “Back Space” No an analysis of the last character remove the last char in the TextBox put cursor at the end of the text play wave “Back Space” Exit Exit TAUCHI MMIG G. Evreinov p 19_23 23.09.2003

  21. Software writing for NIT Lesson4 txtPersonData comments… TWords.txt /phrases GridData1: test words/chars entered text /chars time per char, ms fraData WordsLoading lblSave_Click() lblOpen_Click() lblTestSymbol GridData1_Click() to save column txtText1 GridData2: char per word /phrase num. of entered words num. of strokes /clicks per word /phrase time per word/phrase, s Ctrl+K=>move keys SetSigns On-screen Keyboard Q SetCharacters BackSp GridData2_Click() to save column Clear Data TAUCHI MMIG G. Evreinov p 20_23 23.09.2003

  22. Timer1 Timer2 Software writing for NIT Lesson5 txtPersonData comments… TWords.txt /phrases GridData1: test words/chars entered text /chars time per char, ms fraData WordsLoading lblSave_Click() Test initialization SetTest lblOpen_Click() lblTestSymbol GridData1_Click() to save column SetData txtText1 GridData2: char per word /phrase num. of entered words num. of strokes /clicks per word /phrase time per word/phrase, s Ctrl+K=>move keys SetSigns On-screen Keyboard SetCharacters BackSp Trial start GridData2_Click() to save column Break test Clear Data TAUCHI MMIG G. Evreinov p 21_23 23.09.2003

  23. Timer1 Timer2 Software writing for NIT Lesson6 txtPersonData comments… TWords.txt /phrases GridData1: test words/chars entered text /chars time per char, ms fraData WordsLoading lblSave_Click() Test initialization SetTest lblOpen_Click() lblTestSymbol GridData1_Click() to save column SetData txtText1 GridData2: char per word /phrase num. of entered words num. of strokes /clicks per word /phrase time per word/phrase, s Statistics() Rtime, ms s (st.dev), ms Errors wpm TestTime, s SpotActivate Ctrl+K=>move keys SetSigns On-screen Keyboard SetCharacters BackSp Trial start GridData2_Click() to save column Break test Clear Data TAUCHI MMIG G. Evreinov p 22_23 23.09.2003

  24. Software writing for NIT References http://msdn.microsoft.com/vbasic/ Visual Basic Language and Run-Time Reference http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vboriVBLangRefTopNode.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vaoriStatementsVBA.asp http://msdn.microsoft.com/vbasic/downloads/samples/default.asp VB tutorialhttp://www.juicystudio.com/tutorial/vb/ http://sunny.moorparkcollege.edu/~kmacone/docs/DataTypes.htm http://sunny.moorparkcollege.edu/~kmacone/docs/objProc-Prop.htm http://sunny.moorparkcollege.edu/~kmacone/docs/NamConv.htm http://www.thescarms.com/vbasic/ http://www.planetsourcecode.com Interactive Programming (COM132J2) http://www.infj.ulst.ac.uk/%7Ecnugent/teaching/com148j2/com148j2.htm http://www.fawcette.com/vsm/ http://www.devx.com/dotnet/Default.asp Usability testinghttp://www.tracksys.co.uk/Pages/Usability/usability.htm TAUCHI MMIG G. Evreinov p 23_23 23.09.2003

More Related