Jump to content

toolbar questions


Recommended Posts

hi guy  i  never used  toolbar , i try in  the  script  but  not  work  and not  visualize  nothing  

_Boom() ; cancella tutto quello che trova su la  gui
    $MAG_Group1 = GUICtrlCreateGroup($GUI_Lang[68], 0, 12, 1692, 757); Configurazione Azienda e Documenti
    $Group2 = GUICtrlCreateGroup("Inserimento Prodotti o Servizi", 6, 36, 705, 177)
    $Input1 = GUICtrlCreateInput("Input1", 13, 84, 145, 21)
    $Label1 = GUICtrlCreateLabel("Codice Prodotto", 15, 66, 80, 17)
    $Label2 = GUICtrlCreateLabel("Q.tita", 168, 67, 29, 17)
    $Input2 = GUICtrlCreateInput("Input2", 237, 84, 121, 21)
    $Label3 = GUICtrlCreateLabel("N.° Fattura Acquisto", 237, 68, 99, 17)
    $Input3 = GUICtrlCreateInput("Input3", 366, 84, 337, 21)
    $Label4 = GUICtrlCreateLabel("Nome Prodotto e Servizio", 366, 68, 124, 17)
    $Input4 = GUICtrlCreateInput("Input4", 14, 132, 121, 21)
    $Label5 = GUICtrlCreateLabel("Nome distributore", 14, 116, 86, 17)
    $Input5 = GUICtrlCreateInput("Input5", 142, 132, 73, 21)
    $Label6 = GUICtrlCreateLabel("Spesa Incasso", 142, 116, 74, 17)
    $Input6 = GUICtrlCreateInput("Input5", 222, 132, 73, 21)
    $Input7 = GUICtrlCreateInput("Input5", 302, 132, 73, 21)
    $Input8 = GUICtrlCreateInput("Input5", 383, 132, 73, 21)
    $Input9 = GUICtrlCreateInput("Input9", 14, 180, 97, 21)
    $Label7 = GUICtrlCreateLabel("Prezzo a me unitario", 14, 164, 99, 17)
    $Input10 = GUICtrlCreateInput("Input9", 118, 180, 65, 21)
    $Label8 = GUICtrlCreateLabel("% Ricarico", 122, 164, 54, 17)
    $Input11 = GUICtrlCreateInput("Input9", 190, 180, 97, 21)
    $Label9 = GUICtrlCreateLabel("Prezzo + Iva", 194, 164, 63, 17)
    $Input12 = GUICtrlCreateInput("Input12", 295, 180, 121, 21)
    $Label10 = GUICtrlCreateLabel("Codice a Barre", 297, 164, 74, 17)
    $Input13 = GUICtrlCreateInput("Input9", 165, 84, 65, 21)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group3 = GUICtrlCreateGroup("Importazione Ocr", 715, 36, 972, 289)
    $Edit1 = GUICtrlCreateEdit("", 720, 96, 857, 225)
    GUICtrlSetData(-1, "Edit1")
    $Button1 = GUICtrlCreateButton("Scansione", 1600, 264, 75, 21)
    $Button2 = GUICtrlCreateButton("Importa ", 1601, 293, 75, 21)
    $ToolBar1 = _GUICtrlToolbar_Create($MAG_Group1, 0)

    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $List1 = GUICtrlCreateList("", 4, 327, 1683, 435)
    GUICtrlCreateGroup("", -99, -99, 1, 1)

    GUISetState(@SW_SHOW)
    _GUICtrlToolbar_AddButton($ToolBar1, 0, 0, 0)
    _GUICtrlToolbar_AddButton($ToolBar1, 0, 1, $STD_FILEOPEN)
    _GUICtrlToolbar_AddButton($ToolBar1, 0, 2, 0)
    _GUICtrlToolbar_AddButton($ToolBar1, 0, 3, 0)
    $StatusBar1 = _GUICtrlStatusBar_Create($MAG_Group1)

exist  a mode  for   give  at toolbara  dimension  ??

i want  toolbar over  edit 

 

Link to comment
Share on other sites

Post a runnable script, you've been here long enough to know that.

It's MUCH easier to fix an issue if you post something we can run without having to build it all ourselves.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

; Script Start - Add your code below here
#include <AutoItConstants.au3>
#include <GUIConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
#include <WinAPIRes.au3>
#include <GuiListView.au3>
#include <File.au3>
#include <GuiToolbar.au3>

#NoTrayIcon

Opt("GuiOnEventMode", 1)
Opt("GUICloseOnESC", 0)
Opt("GUIResizeMode", 128)
;Global $Lang[10]

_GUI()


Func _GUI()
    $hMainGUI = GUICreate("GesT", 1692, 808, 192, 114, BitOR($GUI_SS_DEFAULT_GUI, $WS_SYSMENU, $WS_SIZEBOX, $WS_THICKFRAME))

Local Enum $e_idNew, $e_idOpen, $e_idSave, $idHelp
$MAG_Group1 = GUICtrlCreateGroup("de ma de", 0, 12, 1692, 757); Configurazione Azienda e Documenti
    $Group2 = GUICtrlCreateGroup("Inserimento Prodotti o Servizi", 6, 36, 705, 177)
    $Input1 = GUICtrlCreateInput("Input1", 13, 84, 145, 21)
    $Label1 = GUICtrlCreateLabel("Codice Prodotto", 15, 66, 80, 17)
    $Label2 = GUICtrlCreateLabel("Q.tita", 168, 67, 29, 17)
    $Input2 = GUICtrlCreateInput("Input2", 237, 84, 121, 21)
    $Label3 = GUICtrlCreateLabel("N.° Fattura Acquisto", 237, 68, 99, 17)
    $Input3 = GUICtrlCreateInput("Input3", 366, 84, 337, 21)
    $Label4 = GUICtrlCreateLabel("Nome Prodotto e Servizio", 366, 68, 124, 17)
    $Input4 = GUICtrlCreateInput("Input4", 14, 132, 121, 21)
    $Label5 = GUICtrlCreateLabel("Nome distributore", 14, 116, 86, 17)
    $Input5 = GUICtrlCreateInput("Input5", 142, 132, 73, 21)
    $Label6 = GUICtrlCreateLabel("Spesa Incasso", 142, 116, 74, 17)
    $Input6 = GUICtrlCreateInput("Input5", 222, 132, 73, 21)
    $Input7 = GUICtrlCreateInput("Input5", 302, 132, 73, 21)
    $Input8 = GUICtrlCreateInput("Input5", 383, 132, 73, 21)
    $Input9 = GUICtrlCreateInput("Input9", 14, 180, 97, 21)
    $Label7 = GUICtrlCreateLabel("Prezzo a me unitario", 14, 164, 99, 17)
    $Input10 = GUICtrlCreateInput("Input9", 118, 180, 65, 21)
    $Label8 = GUICtrlCreateLabel("% Ricarico", 122, 164, 54, 17)
    $Input11 = GUICtrlCreateInput("Input9", 190, 180, 97, 21)
    $Label9 = GUICtrlCreateLabel("Prezzo + Iva", 194, 164, 63, 17)
    $Input12 = GUICtrlCreateInput("Input12", 295, 180, 121, 21)
    $Label10 = GUICtrlCreateLabel("Codice a Barre", 297, 164, 74, 17)
    $Input13 = GUICtrlCreateInput("Input9", 165, 84, 65, 21)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group3 = GUICtrlCreateGroup("Importazione Ocr", 715, 36, 972, 289)
    $Edit1 = GUICtrlCreateEdit("", 720, 96, 857, 225)
    GUICtrlSetData(-1, "Edit1")
    $Button1 = GUICtrlCreateButton("Scansione", 1600, 264, 75, 21)
    $Button2 = GUICtrlCreateButton("Importa ", 1601, 293, 75, 21)
    $ToolBar1 = _GUICtrlToolbar_Create($MAG_Group1, 0)

    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $List1 = GUICtrlCreateList("", 4, 327, 1683, 435)
    GUICtrlCreateGroup("", -99, -99, 1, 1)

    GUISetState(@SW_SHOW)
    _GUICtrlToolbar_AddButton($ToolBar1, 0, 0, 0)
    _GUICtrlToolbar_AddButton($ToolBar1,  $e_idOpen, $STD_FILEOPEN)
    _GUICtrlToolbar_AddButton($ToolBar1, 0, 2, 0)
    _GUICtrlToolbar_AddButton($ToolBar1, 0, 3, 0)
    $StatusBar1 = _GUICtrlStatusBar_Create($MAG_Group1)

EndFunc


Func _close()

    Exit

EndFunc   ;==>_close

;===============================================================

;Keep the GUI alive

;===============================================================

While 1

    Sleep(1000)

WEnd

 

Edited by faustf
Link to comment
Share on other sites

$ToolBar1 = _GUICtrlToolbar_Create($MAG_Group1, 0)

_GUICtrlToolBar_Create needs a hwnd to a window. You can create it using your group as the parent but you need to get the handle to it. However, I'm guessing this was not what you intended, you most likely wanted the toolbar for your actual gui.

So change it to

$ToolBar1 = _GUICtrlToolbar_Create($hMainGUI, 0)

Unless you wanted a toolbar under your group control, then use this

$ToolBar1 = _GUICtrlToolbar_Create(GUICtrlGetHandle($MAG_Group1), 0)

 

Edited by InunoTaishou
Link to comment
Share on other sites

Yeah, move your group box closer to the edit, or create a label closer to the edit.

#include <GUIConstants.au3>
#include <GuiToolbar.au3>

Global $hGui = GUICreate("Example", 500, 400)
Global $hEdit = GUICtrlCreateEdit("Example edit", 20, 64, 460, 320)
Global $hGroup = GUICtrlCreateGroup("", 10, 10, 480, 380)
Global $hLabel = GUICtrlCreateLabel("", 12, 16, 476, 48)
Global $hToolbar = _GUICtrlToolbar_Create(GUICtrlGetHandle($hLabel), 0)
_GUICtrlToolbar_SetButtonWidth($hToolbar, 32, 48)
For $i = 0 to 12
    _GUICtrlToolbar_AddButton($hToolbar, 1000 + $i, -2, _GUICtrlToolbar_AddString($hToolbar, "Btn" & $i))
Next

GUISetState(@SW_SHOW, $hGui)

Do

Until (GUIGetMsg() = $GUI_EVENT_CLOSE)

 

Link to comment
Share on other sites

but  how  is possible insert icon???   over  the  button???  i tryed   but  not appear nothing  

$Label11 = GUICtrlCreateLabel("", 720, 64, 852, 28)


    $Button1 = GUICtrlCreateButton("Scansione", 1600, 264, 75, 21)
    $Button2 = GUICtrlCreateButton("Importa ", 1601, 293, 75, 21)
    Local $ToolBar1 = _GUICtrlToolbar_Create($Label11, 0)
$ToolBar1 = _GUICtrlToolbar_Create(GUICtrlGetHandle($Label11), 0)
_GUICtrlToolbar_AddButton($ToolBar1, $e_idOpen, $STD_FILEOPEN)
_GUICtrlToolbar_AddButton($ToolBar1, $e_idOpen, $STD_FILEOPEN)
_GUICtrlToolbar_AddButton($ToolBar1,  $e_idOpen, $STD_FILEOPEN)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $List1 = GUICtrlCreateList("", 4, 327, 1683, 435)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)


    $StatusBar1 = _GUICtrlStatusBar_Create($Label11)

 

Edited by faustf
Link to comment
Share on other sites

Any possibility of you posting a single post instead a group of them all at once?

Also, any possibility of you actually reading the help file or at least looking at the list of functions in it

If I wanted to load my own bitmaps onto a toolbar, I would probably look at the _GUICtrlToolbar section of functions, and find one that might by some chance say load bitmap somewhere in its name, or even one that has imagelist in its name as a start. If I wanted to see what these functions did, to see if they were what I might want to use to accomplish loading a bitmap or icon onto a toolbar button, I would run the example scripts that are there, play around with them and see if they might do it.

After looking through the entire list of _GUICtrlToolbar functions, and trying any that might look promising, and if I couldn't find what I needed, then and only then would I make a post asking for help. Because I have exhausted all probabilities first and couldn't find the answer.

I would NOT make a post, then read the help file, and find what I was looking for 5 minutes later, after wasting my time and other's, and then making another unnecessary post and say "Hey guess what, I found what I needed on my own, sorry for wasting your time"

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Hi guy i have  a little  question about  bitmap toolbar  .  with resurce hacker  i saw  in  shell32.dll ,  and  saw  exist  a folder for  bitmap .

1  questions:  if  i  insert  in  shell32.dll,  in  folder bitmap , my new personal bitmap ,  is possible  use with toolbar ?? if  yes  how  ??  exist some  example??

thankz  so much  at  all

 

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...