Jump to content

Help with MDI and Toolbar


 Share

Recommended Posts

I am using both MDI and a Toolbox. The problem i have is that when i maximize a child window, it overlaps my toolbar.

I would like my child window to maximize below the toolbar, much like it does for the Menus.

Here is my code:

CODE
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.4.9

Author: myName

Script Function:

Template AutoIt script.

#ce ----------------------------------------------------------------------------

#include <GUIConstants.au3>

#include <database.au3>

#include <A3LToolbar.au3>

Global Enum $idNew=1000, $idOpen, $idSave, $idHelp

; Script Start - Add your code below here

$main = GUICreate("Spell Inventory", 800, 500, -1,-1, $WS_OVERLAPPEDWINDOW)

GUISetState ()

$dbname = "C:\Documents and Settings\sjraisbe\Desktop\SI\database.mdb"

$tblname = "Spells"

$fldname = "Spell"

;MI = menu item

;-----File Menu-----

$fileMenu = GuiCtrlCreateMenu ("File")

$importMI = GuiCtrlCreateMenuitem ("Import File",$filemenu)

$separator = GuiCtrlCreateMenuitem ("",$filemenu)

$ppOptionsMenu = GuiCtrlCreateMenu ("Print Preview Options",$filemenu)

$separator = GuiCtrlCreateMenuitem ("",$filemenu)

$exitMI = GuiCtrlCreateMenuitem ("Exit",$filemenu)

;-----Tools Menu-----

$toolsMenu = GuiCtrlCreateMenu ("Tools")

$manageSpellbooksMI = GuiCtrlCreateMenuitem ("Manage Spellbooks",$toolsMenu)

$manageSchoolsMI = GuiCtrlCreateMenuitem ("Manage Schools",$toolsMenu)

$manageSpellsMI = GuiCtrlCreateMenuitem ("Manage Spells",$toolsMenu)

$separator = GuiCtrlCreateMenuitem ("",$toolsMenu)

$manageScrollsMI = GuiCtrlCreateMenuitem ("Manage Scrolls",$toolsMenu)

$separator = GuiCtrlCreateMenuitem ("",$toolsMenu)

$searchMI = GuiCtrlCreateMenuitem ("Search",$toolsMenu)

;-----Window Menu-----

$windowMenu = GuiCtrlCreateMenu ("Window")

$tileMI = GuiCtrlCreateMenuitem ("Tile",$windowMenu)

$separator = GuiCtrlCreateMenuitem ("",$windowMenu)

$cascadeMI = GuiCtrlCreateMenuitem ("Cascade",$windowMenu)

;-----About Menu-----

$aboutMenu = GuiCtrlCreateMenu ("About")

$helpTopicsMI = GuiCtrlCreateMenuitem ("Help Topics",$aboutMenu)

$separator = GuiCtrlCreateMenuitem ("",$aboutMenu)

$aboutMI = GuiCtrlCreateMenuitem ("About SI",$aboutMenu)

$hToolbar = _Toolbar_Create($main)

; Add standard system bitmaps

_Toolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR)

; Add buttons

_Toolbar_AddButton ($hToolbar, $idNew , $STD_FILENEW )

_Toolbar_AddButton ($hToolbar, $idOpen, $STD_FILEOPEN)

_Toolbar_AddButton ($hToolbar, $idSave, $STD_FILESAVE)

_Toolbar_AddButtonSep($hToolbar)

_Toolbar_AddButton ($hToolbar, $idHelp, $STD_HELP )

;$viewSpell = GUICtrlCreateButton ("1", 0,0,30,30,$BS_ICON)

;GUICtrlSetImage (-1, "shell32.dll",134)

$child = GUICreate("View Spells", 200, 200, 40, 0, $WS_OVERLAPPEDWINDOW)

DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($child), "hwnd", WinGetHandle($main))

GUISetState ()

do

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE Or $msg = $exitMI

ExitLoop

Case $msg = $aboutMI

Msgbox(0,"About","Spell Inventory")

EndSelect

until $msg = $GUI_EVENT_CLOSE

GUIDelete()

Exit

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...