Sign in to follow this  
Followers 0
Andreik

Text alignment in toolbar control

5 posts in this topic

Why the text it's not vertically aligned in toolbar control?

#include <GuiReBar.au3>
#include <GuiToolbar.au3>
#include <Constants.au3>

Global Enum $Item1 = 1000, $Item2, $Item3

Local $hGUI = GUICreate('Example',450,300)
Local $hRebar = _GUICtrlRebar_Create($hGUI, BitOR($RBS_FIXEDORDER,$CCS_NODIVIDER,$RBS_BANDBORDERS))
Local $hToolbar = _GUICtrlToolbar_Create($hGUI,$TBSTYLE_TRANSPARENT)
_GUICtrlToolbar_AddString($hToolbar,'Item# 1')
_GUICtrlToolbar_AddString($hToolbar,'Item# 2')
_GUICtrlToolbar_AddString($hToolbar,'Item# 3')
_GUICtrlToolbar_AddButton($hToolbar,$Item1,-2,0)
_GUICtrlToolbar_AddButton($hToolbar,$Item1,-2,1)
_GUICtrlToolbar_AddButton($hToolbar,$Item1,-2,2)
_GUICtrlToolbar_SetButtonSize($hToolbar,32,150)
_GUICtrlRebar_AddToolBarBand($hRebar,$hToolbar)
GUISetState(@SW_SHOW,$hGUI)
Do
    Sleep(10)
Until GUIGetMsg() = -3 ; GUI_EVENT_CLOSE

The code above will prodoce a window that will look like

21l6edx.png


When the words fail... music speaks

Share this post


Link to post
Share on other sites



Would something like this be what you want?  

REB


MEASURE TWICE - CUT ONCE

Share this post


Link to post
Share on other sites

It's not related with what I asked. I just want to display the text vertically aligned.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

Because of the size of your undefinied bitmaps : the text is placed under the bitmap, but you don't have any bitmap...

So just define the size of the bitmaps - even if you do not use any

Local $hToolbar = _GUICtrlToolbar_Create($hGUI,$TBSTYLE_TRANSPARENT)
_GUICtrlToolbar_SetBitmapSize($hToolbar, 0, 0)

Share this post


Link to post
Share on other sites

Thank you, but this is weird. If I use just text then size of bitmaps should be by default 0. Anyway, many thanks.


When the words fail... music speaks

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

  • Similar Content

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Guys this is my gui and i need the numeric value typed in the highlighted  inputbox. if this value is greater than 1 i need to perform some operations
      \
       
      Here is the summary about that field which i got from wininfo tool

      i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it... 

      here i am using the valu present in the field

      can you guys tell me what's wrong??? or how can i get that value?
       
      My_GUI.au3

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      in need the path/text present int above shown input box to be copied or retrieved into a variable .. how can i do that?
       
      Thanks
       
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Friends i am new to autoit and i am stuck in middle of automation of flashing tool..
      my requirement is i have a window and i have to get the value present in that window (below is the picture)

      in the above window i need to get the value of the highlighted field.the value of this filed keeps on changing...ii need to get the current value present in the field..below are the details of the window and field..

       
      CAN it be done?
       
      thanks

    • SteveJM
      By SteveJM
      I have a working program currently driven largely through menu selections. I would like to add a toolbar where most of the tollbar button actions are basically the same as menu items, but quicker to access. I have been wading around in toolbar examples, MSDN pages etc, it's clearly going to be a bit of a slog to get everything right, including tooltips etc. I thought I would start with something simple to prove the principle.
      Using bits from the help file examples I have a small program that successfully displays a toolbar. However, what seemed like the most elegant way to deal with the button commands does not seem to work. My understanding was that a toolbar button fires a WM_COMMAND message, with the command Id set by the second parameter in the call to
      _GUICtrlToolbar_AddButton ( $hWnd, $iID, $iImage)
      so I though it would be a good idea to set this Id to the same value as my menu item Id; then it would run the same task which is what I wanted. This did not work. I am using message loop mode and would like to stick with this because some of my scripts run hardware at the same time as the gui; it is easier if I don't have to worry about code being interrupted with the hardware in an unknown state . So I added a handler for WM_COMMAND, with some cribbed display code to try and see why. The toolbar button defintely fired a WM_COMMAND message and the Id looked the same, so no explanation there.
      I guess the issue is with GUIGetMsg() which may be constructed to ignore all but a limited number of control handles, i.e. those made with the GuiCtrlCreate... commands; this is speculation.
      I would dearly love to find a tidy way to get around this. Having some controls handled in the message loop and some in a WM_COMMAND handler, performing the same task, feels ugly. I would be very grateful for further insight from someone experienced with handling a toolbar. Perhaps I should be trying to fire the menu item. I have attached a code snippet to try and illustrate the issue.
       
       
       
      ToolbarTrial.au3
    • houser747
      By houser747
      I have previously used _IEFormElementGetObjByName and _IEFormElementSetValue to enter text into a search box on a form and then submit the form.
      I am now trying to enter text into a search box which is not part of a form. 
      Here is the HTML from the website that i'm trying to enter the data on and then submit the search.
      <div class="row">
          <div class="form-group col-xs-12">
              <span id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_lblSearchText" for="input-search">Registreringsbeteckning</span>
              <div class="input-group col-xs-12">
                  <span id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_preSearchText" class="input-group-addon">SE -</span>
                  <input name="ctl00$FullWidthWithSubmenuContent$FullWidthContent$MainContent$AircraftRegistry$txtSearchText" type="text" value="DTH" id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_txtSearchText" class="form-control" />
              </div>
          </div>
      </div>
      <div class="row">
          <div class="form-group col-xs-12">
              <label class="sr-only" for="">Sök</label>
              <input type="submit" name="ctl00$FullWidthWithSubmenuContent$FullWidthContent$MainContent$AircraftRegistry$btnSearch" value="Sök" id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_btnSearch" class="btn btn-primary ladda-button" data-style="expand-right" />
          </div>
      </div>
      Many thanks in advance
      cheers
      Roger