Sign in to follow this  
Followers 0
brycetech

Button Bar not working on laptop

2 posts in this topic

Hi

I'm relatively new to autoit, but not to coding. I like the fact that you dont have to install autoit programs to get them to work.

Im creating a program that will write and read and troubleshoot specific files needed for our server.

the file menu functions work..which just call separate functions for open, close, read, etc

I have created a toolbar full of buttons which also just call those same functions listed above. I know those functions work, but when I use the toolbar on a laptop, the toolbar does not work. It is not recieving any data from the dllstructgetdata call from the laptop touchpad "code" function.

this is just hte wm notify part...

<snip>

Func _WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam)

#forceref $hWndGUI, $MsgID, $wParam

Local $tNMHDR, $event, $hwndFrom, $code, $i_idNew, $dwFlags, $lResult, $idFrom, $i_idOld

Local $tNMTOOLBAR, $tNMTBHOTITEM, $tInfo, $filetosavetemp

$tNMHDR = DllStructCreate($tagNMHDR, $lParam)

$hwndFrom = DllStructGetData($tNMHDR, "hWndFrom")

$idFrom = DllStructGetData($tNMHDR, "IDFrom")

$code = DllStructGetData($tNMHDR, "Code")

Switch $hwndFrom

Case $ToolBar1

MsgBox(0, "Test", $hwndfrom & " " & $idfrom & " " & $code);this code works

Switch $code

Case $NM_LDOWN

Switch $iItem

Case 0 ; New Click

reset()

GUICtrlSetData($ruletext, "")

GUICtrlSetData($myerrors, "")

Case 1 ; Open Click

$script = FileOpenDialog('Open and do not evaluate the Expert Rule', @ScriptDir, 'RUL Files (*.rul)')

open()

Case 2 ; OpenAs click

reset()

$script = FileOpenDialog('Open and evaluate the Expert Rule', @ScriptDir, 'RUL Files (*.rul)')

openas()

Case 3 ; Save

If $script <> "" Then

save()

Else

If $script <> "" Then

$filetosave = FileSaveDialog("Save Expert Rule As.", @ScriptDir, "Expert Rule Files (*.rul)", 2, $script)

Else

$filetosave = FileSaveDialog("Save Expert Rule As.", @ScriptDir, "Expert Rule Files (*.rul)", 2)

EndIf

saveas()

EndIf

Case 4 ;save as

If $script <> "" Then

$filetosave = FileSaveDialog("Save Expert Rule As.", @ScriptDir, "Expert Rule Files (*.rul)", 2, $script)

Else

$filetosave = FileSaveDialog("Save Expert Rule As.", @ScriptDir, "Expert Rule Files (*.rul)", 2)

EndIf

saveas()

Case 5 ;cut

Case 6 ;copy

Case 7 ;paste

Case 8 ;find

Case 9 ;replace

Case 10 ;print

Case 11 ;check

$bracketcount = 0

$parenthesiscount = 0

$bracecount = 0

$filetosavetemp = $script

$script = @ScriptDir & "/data/temp.rul"

save()

openas()

$script = $filetosavetemp

Case 12 ;upload

Case 13 ;wizard

Case 14 ;help

case else

EndSwitch

;----------------------------------------------------------------------------------------------

Case $TBN_HOTITEMCHANGE

$tNMTBHOTITEM = DllStructCreate($tagNMTBHOTITEM, $lParam)

$i_idOld = DllStructGetData($tNMTBHOTITEM, "idOld")

$i_idNew = DllStructGetData($tNMTBHOTITEM, "idNew")

$iItem = $i_idNew

$dwFlags = DllStructGetData($tNMTBHOTITEM, "dwFlags")

If BitAND($dwFlags, $HICF_LEAVING) = $HICF_LEAVING Then

ToolTip("")

Else

;GUICtrlSetData($ruletext, $i_idNew)

Switch $i_idNew

Case 0 ;New

ToolTip("New")

Case 1 ;Open

ToolTip("Open without processing")

Case 2 ;OpenAs

ToolTip("Open and process")

Case 3 ;Save

ToolTip("Save and overwrite file")

Case 4 ;save as

ToolTip("Save to a different file name")

Case 5 ;cut

ToolTip("Cut selected text from window")

Case 6 ;copy

ToolTip("Copy selected text")

Case 7 ;paste

ToolTip("Paste text")

Case 8 ;find

ToolTip("Find text")

Case 9 ;replace

ToolTip("Find and replace text")

Case 10 ;print

ToolTip("Print rul file")

Case 11 ;check

ToolTip("Evaluate expert rule")

Case 12 ;upload

ToolTip("Upload file to server")

Case 13 ;wizard

ToolTip("Expert rule wizard")

Case 14 ;help

ToolTip("Help")

EndSwitch

EndIf

EndSwitch

EndSwitch

;msgbox(0,"TEST",$iItem)

Return $GUI_RUNDEFMSG

EndFunc ;==>_WM_NOTIFY

</snip>

Is there another include or something I need to add to make it read that from a laptop touch pad?

#include <StructureConstants.au3>

#include <ToolTipConstants.au3>

#include <File.au3>

#include <GUIConstantsEx.au3>

#include <GUIListBox.au3>

#include <WindowsConstants.au3>

#include <EditConstants.au3>

#include <StaticConstants.au3>

#include <GuiImageList.au3>

#include <GuiToolbar.au3>

#include <ImageListConstants.au3>

#include <ToolbarConstants.au3>

#include <GuiEdit.au3>

#include <GuiToolTip.au3>

#include <GuiEdit.au3>

The code is very long and sloppy..but I know it works as expected on a desktop, just the toolbar doesnt work for the laptop. I cant even get it to send a simple "msgbox" from the click of the buttonbar.

any help and/or suggestions appreciated.

thanx

BT

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

First, use Tidy autoit source code so it's easier to read. Second, post the code inside an autoit tag

...
to make it easier for everyone to read.

Edited by trung0407

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