Getting Started
Introduction
Sample Programs
IDEs
History
Advice
Mini-Tutorial
Tutorials
Code Snippets

Resources
Web Sites
More Tutorials
Forums
Vendors/Tools
Books
Magazines
Newsletters
NewsGroups
User Groups
Talk Shows
Blogs

Controls
Overview
Button
Check3State
Checkbox
ComboBox
Frame
Graphic
Image
ImageX
ImgButton
ImgButtonX
Label
Line
ListBox
ListView
Option
Progress Bar
Scrollbar
StatusBar
TAB
TextBox
Toolbar
TreeView

GBIC >> PowerBASIC >> Tutorials >> Splash Page

PowerBASIC Information Center Tutorials
These tutorials were written to help you get a quick, but thorough, understanding of PowerBASIC - the scope of the language as well as it's specific capabilities.

Introduction       Projects       Language           Messages       Functions           Advanced
  • Overview
  • Examples
  • IDE
  • Compilation
  • Distribution
  • Project Files
  • DDT Windows
  • Controls
  • Menus
  • Dialogs  
  • Help Files
  • Resources  
  • Templates  
  • Project Shell  
  • Syntax
  • Operators
  • Data Types
  • Variables
  • Scope
  • Declarations  
  • Procedures
  • Flow Control
  • Windows
  • Messages
  • Callbacks
  • Mouse
  • Keyboard
  • Dialogs
  • Controls
  • Subclassing
  • Arithmetic
  • Trig  
  • Strings
  • Arrays
  • Date/Time
  • Printing
  • Files
  • Folders
  • Keyboard
  • Mouse
  • Sound
  • System
  • Error Traps
  • Debugging
  • Objects
  • Graphics
  • Databases
  • API
  • DLLs
  • ASM
  • Threads
  • Project Shell
    When I start a new project there are a lot of common features that I want to include - main window, toolbar, specific menu items (esp. under Help), splash screen, about form, window splitter and more.

    So, I decided to create a template with the basic functions and post it here. With all the time I'm spending on writing these tutuorials, I'm afraid I haven't given this page much priority as yet. But, here's what I have so far.

             

    And here's the shell source code to generate the dialog and menu you see above.

    #Compile Exe
    #Dim All
    #Include "Win32api.inc"
    
    %ID_Open = 201
    %ID_Save = 202
    %ID_SaveAs = 203
    %ID_Exit = 204
    
    %ID_Email = 901
    %ID_WebSite = 902
    %ID_Help = 903
    %ID_Update = 904
    %ID_About = 905
    
    Function PBMain()
    
    Dim hDlg As Dword
    Dialog New 0, "My Dialog",,, 150,100, %ws_overlappedwindow , To hDlg
    
    'Create Bar -------------------------
    Dim hMenu As Dword
    Menu New Bar To hMenu
    
    'Create File + Children -------------------------
    Dim hMenuFile As Dword
    Menu New PopUp To hMenuFile
    Menu Add PopUp, hMenu, "&File", hMenuFile, %mf_enabled
    
    Menu Add String, hMenuFile, "&Open", %ID_Open, %mf_enabled
    Menu Add String, hMenuFile, "&Save", %ID_Save, %mf_enabled
    Menu Add String, hMenuFile, "&Save As ..", %ID_SaveAs, %mf_enabled
    Menu Add String, hMenuFile, "E&xit", %ID_Exit, %mf_grayed   '%mf_enabled
    
    'Create Help + Children -------------------------
    Dim hMenuHelp As Dword
    Menu New PopUp To hMenuHelp
    Menu Add PopUp, hMenu, "&Help", hMenuHelp, %mf_enabled
    
    Menu Add String, hMenuHelp, "&Email Author", %ID_Email, %mf_enabled
    Menu Add String, hMenuHelp, "&WebSite", %ID_WebSite, %mf_enabled
    Menu Add String, hMenuHelp, "&Online Help ..", %ID_Help, %mf_enabled
    Menu Add String, hMenuHelp, "&Online Update ..", %ID_Update, %mf_enabled
    Menu Add String, hMenuHelp, "&About ..", %ID_About, %mf_enabled
    
    'Attach Bar to Dialog -------------------------
    Menu Attach hMenu, hDlg
    
    Dialog Show
    

    If you have any suggestions or corrections, please let me know.