Copyright © 2004-2013 Curt Hill More Components Varying the input of Dev-C++ Windows Programs.

Slides:



Advertisements
Similar presentations
Microsoft Office 2007-Illustrated Introductory, Windows Vista Edition Windows XP Unit A.
Advertisements

Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
Using Macros and Visual Basic for Applications (VBA) with Excel
110-H1 More VB Tools Creating a Menu: What is a menu? a group of (related) commands displayed at at the top of an application Top level menu Disabled command.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Automating Tasks With Macros
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
Customizing Forms and Writing QuickBooks Letters Lesson 15.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Chapter 8: String Manipulation
CHAPTER SIX Loop Structures.
CHAPTER 6 Loop Structures.
PROG Mobile Java Application Development PROG Mobile Java Application Development Event Handling Creating Menus.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
Customizing forms and writing QuickBooks Letters Lesson 15.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
Power Point EDU 271 Microsoft PowerPoint is a powerful tool to create professional looking presentations and slide shows. PowerPoint allows you to construct.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
1 CA201 Word Application Increasing Efficiency Week # 13 By Tariq Ibn Aziz Dammam Community college.
Multiple Forms, Standard Modules, And Menus
GUI’s Part Two wxWidgets components. Resources for wxWidgets Sample code on course website wxWidgets web site.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
CIS—100 Chapter 15—Windows Vista 1. Parts of a Window 2.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
1 Working with Menus and Dialog Boxes. 2 Objectives You will be able to Create and edit menus for Windows Forms applications. Write code to handle menu.
1 The EDIT Program The Edit program is a full screen text editor that allows you to: Create text files Create text files Edit an existing text files Edit.
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
Productivity Programs Common Features and Commands.
Windows Tutorial Common Objects ACOS: 1, 4. Using the Taskbar 1. Using the taskbar, you can switch between open programs and between open documents within.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 – Graphical User Interfaces Part 2 Outline.
Copyright © Curt Hill First Window Builder Program Easy GUIs in Eclipse.
XP New Perspectives on Microsoft Windows 2000 Professional Windows 2000 Tutorial 1 1 Microsoft Windows 2000 Professional Tutorial 1 – Exploring the Basics.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
Visual Basic Programming Chapter Six Notes Repetition and the Do Statement ADDING ICONS TO YOUR FORM –It is possible to add an ______________ to your title.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Microsoft Office XP Illustrated Introductory, Enhanced Started with Windows 2000 Getting.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Eight String Manipulation.
Computing Fundamentals Module Lesson 7 — The Windows Operating System Computer Literacy BASICS.
Slide 1 Using Menu Bar & Common Dialog Boxes. Slide 2 Setting Up the Main Items v First open the form on which you want the menu located v Then start.
7-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Copyright © Curt Hill More Widgets In Abstract Window Toolbox.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
Compunet Corporation Programming with Visual Basic.NET Working with Menus and Dialog Boxes Week 14 Tariq Aziz and Kevin Jones.
Copyright © – Curt Hill Building Windows Applications in wxDev-C++
Copyright © Curt Hill Common Dialogs Easily Obtaining File Names in DevC++ Windows Programs.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
Integrating Components and Dynamic Text Boxes with the Animated Map– Lesson 101 Integrating Components and Dynamic Text Boxes with the Animated Map Lesson.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Chapter 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
Menu & Clipboard Menu Cut / Copy / Paste. Menus Created in the Menu Editor Can contain menu titles, menu items, separator bars, submenu titles, and submenu.
Console and GUI Programs
An Introduction to Computers and Visual Basic
Using Procedures and Exception Handling
Predefined Dialog Boxes
Items, Group Boxes, Check Boxes & Radio Buttons
An Introduction to Computers and Visual Basic
Presentation transcript:

Copyright © Curt Hill More Components Varying the input of Dev-C++ Windows Programs

Which Widgets? Menus Memos Check boxes Radio buttons List Boxes Copyright © Curt Hill

Menus Two types: –Main menu – usually just below the title bar –Popup – usually the result of a right click What is it? –Just a specialized set of buttons Where: Menubars Today we are only interested in the main menu Copyright © Curt Hill

Main Menu Click on wxMenuBar and drop on form It creates a component that does not look right until you run it Customize by clicking on the MenuItems entry –This brings the menu editor to front Then fill in the menu items Copyright © Curt Hill

Initially Copyright © Curt Hill

Dropped Copyright © Curt Hill

Click Menu Items Copyright © Curt Hill

After Enter Copyright © Curt Hill

Notes The menu editor will allow you to create the top level menu and submenus –We will create File and Help for top level We click Add Item button for each entry –Fill in caption –Click apply The top level menu often has no event handler Copyright © Curt Hill

After clicking add item Copyright © Curt Hill

After clicking Create SubMenu Copyright © Curt Hill

Basic Menu Design Copyright © Curt Hill

Applying Events A menu entry should act like a button Clicking it should take us to an event Clicking a top level menu may only display a submenu –The event is done for us Now we apply the events –Click on Create –We get a save dialog –Then next screen Copyright © Curt Hill

Add Event Copyright © Curt Hill

Menu vs. Button When we create an event for a button it immediately takes us to the code panel When we create an event for a menu it creates the event but leaves us in design mode We do them all then look at code Copyright © Curt Hill

One More Trick In the caption one ampersand may be inserted This causes the letter following it to be executed to be as a shortcut key Holding Alt and the letter is the same as clicking the mouse Each menu should only use a shortcut key once Copyright © Curt Hill

Multi-Line EditBox A normal Edit has just one line What if we want multiple lines? Makes a nice area to log messages to the user Use the Memo in Common Controls We do handle it a little differently than an Edit Copyright © Curt Hill

Memo in DevCPP The Strings property contains all the lines –Rarely is this assigned or referenced The AppendText method is usually used to add new material at bottom Escape sequences do work –Such as \n Use the cast to wxString and put to (<<) to display variables Copyright © Curt Hill

String List Editor Copyright © Curt Hill Click on the ellipsis (…) of the Strings property This starts the String List Editor This sets initial values

Starting Copyright © Curt Hill

After Setting Copyright © Curt Hill

Closed Copyright © Curt Hill

Check Boxes Easiest way to enter a boolean value A check box may be checked or not –Initialized in either form Design property is Checked –Use GetValue or IsChecked method Caption property is text next to checkbox Typical statement might be: if(CheckBox1->IsChecked()){ // do something Copyright © Curt Hill

Radio Buttons The most visual way to choose one out of 3 to 5 Similar to a check box but only one may be selected Clicking one clears all the rest Checked is still the property May be set at runtime by SetValue, obtained by GetValue or IsChecked Copyright © Curt Hill

Radio Buttons Copyright © Curt Hill

Notes Radio buttons are round and Check boxes are square Caption is the name next to checkbox –Set to name Checked is the bool Last one added will be checked if none of the previous ones are checked –Will not see this in property inspector Copyright © Curt Hill

Why Just 3 – 5? Not an absolute rule Two radio buttons could be replaced by one check box More than five radio buttons gets to be too bulky Use a List box for that –It may have very many items but only uses a small space Copyright © Curt Hill

Determining Values The Radio button also has GetValue and IsChecked Is that the best way to find what is checked? What would be needed was a series of nested ifs: if(Radio1->IsChecked()){ … } else if(Radio2->IsChecked()){ … } else if(Radio3->IsChecked()){ … } else if(Radio4->IsChecked()){ … } Cannot use a switch for this Copyright © Curt Hill

Is there a better way? Use an enumeration One for each radio button and one for the unselected case Use the On Click event handler for the radio button to set the enumeration to this value When needing to decide on the radios, then use a switch on the enumeration Copyright © Curt Hill

List Boxes Way to choose one from many Shows only a few, but allows scrolling Items is the property that holds the lines Multiple items may be selected if a property is set Copyright © Curt Hill

wxListBox Items edited with the String List Editor GetSelection tells which is selected Zero based Selection does not show in object inspector If nothing selected then -1 GetString(int) will show you the item corresponding to any number Copyright © Curt Hill

Caution We may get the string like this: List1->GetString( List1->GetSelection()) If this is used and no item is selected then the program will be aborted Use an if to protect against that -1 return value Copyright © Curt Hill

Code int i = List1->GetSelection(); if(i >= 0) Memo1->AppendText( List1->GetString(i)); else Memo1->AppendText( "Nothing selected\n"); Copyright © Curt Hill

Finally There are many other controls We will not need most of these for this class This should give sufficient control Now is the time for the demo Copyright © Curt Hill