Sign in to follow this  
Followers 0
momar33

Help with MDI and Toolbar

3 posts in this topic

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

Share this post


Link to post
Share on other sites



If there is a way to do this using Image Buttons, that would work also.

Share this post


Link to post
Share on other sites

Anybody?

Share this post


Link to post
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
Sign in to follow this  
Followers 0