Jump to content

Recommended Posts

Posted (edited)

Andreik It would probably be:

Func _MyUIApp_OnViewChanged($pSelf, $iViewId, $iTypeId, $pView, $iVerb, $iReason)
    #forceref $pSelf, $iViewId, $iTypeId, $pView, $iVerb, $iReason
    Local Static $g_pRibbon
    Switch $iVerb
        Case 0  ;UI_VIEWVERB_CREATE
            ConsoleWrite("UI_VIEWVERB_CREATE" & @CRLF)
            If Not IsObj($g_pRibbon) Then
                Local $oUnknown = ObjCreateInterface($pView, $sIID_IUnknown, "")
                $oUnknown.AddRef()
                Local $pRibbon
                $oUnknown.QueryInterface($sIID_IUIRibbon, $pRibbon)
                $g_pRibbon = ObjCreateInterface($pRibbon, $sIID_IUIRibbon, $tagIUIRibbon)
            EndIf
        Case 2  ;UI_VIEWVERB_SIZE
            ConsoleWrite("UI_VIEWVERB_SIZE" & @CRLF)
            Local $uRibbonHeight
            If IsObj($g_pRibbon) Then $g_pRibbon.GetHeight($uRibbonHeight)
            ConsoleWrite("$uRibbonHeight = " & $uRibbonHeight & @CRLF)
    EndSwitch
    Return 0 ; S_OK
EndFunc
Edited by trancexx

♡♡♡

.

eMyvnE

Posted (edited)

Thank you it works but now I'm confused. Based on what it's calculated the height of the ribbon? I have a windows that cannot be resized and the ribbon is 146 px height on (readed in _MyUIApp_OnViewChange and with AutoIt Info Tool, same value no matter used machine) but on different machines, the appearance is not the same.

snc3ed.png   35c3ml4.png

LE: I forgot to mention how other controls are created.

The controls are created at positions based on ribbon height + an offset. For example the most left label that surround the treeview it located at position 150 (146 ribbon height + 4px).

Edited by Andreik
Posted

That looks to me as if the quick access toolbar (being right of the window's icon) of the ribbon was placed below the ribbon and then put above after the other controls have been created. In that case an offset of about 25px would have been created.

Do you rearrange other controls every time OnViewChanged is called? You should.

♡♡♡

.

eMyvnE

Posted

Ok, let's say I rearrange all controls every time OnViewChange is called but how can I know how to rearrange them because I know just the ribbon actions: UI_VIEWVERB_CREATE, UI_VIEWVERB_SIZE. For example UI_VIEWVERB_SIZE is called when I minimize/restore the ribbon or when I set the quick access below or above the ribbon. When I minimize the ribbon, controls should be placed in a position different than when quick acees is placed below ribbon. Or maybe if it's possible I would like to remove these options.

Posted

Don't remove them. They make ribbon what ribbon is.

What do you mean you don't know how to rearrange the controls. Are we talking about the same controls? I'm talking about controls that you make in your gui - buttons, listviews, etc...

♡♡♡

.

eMyvnE

Posted

Yes, about the controls used in my gui. If I choose to minimize the ribbon all my gui controls should be moved a little up but how can I know I choosed to minimize the ribbon and not to place the quick access bar below ribbon case when all my gui controls should be moved a little down. All I said it's both actions are trapped in OnViewChange with message UI_VIEWVERB_SIZE and no more informations about.

Posted

Hm, I don't get it. Can you upload your files so that I can try.

I have updated the first post with new/old example and I'm moving controls as ribbon moves there. Do you have problems with that script?

♡♡♡

.

eMyvnE

Posted

No I haven't and now I made my script to move well the controls. If you don't mind I would have one more question. When my gui is resizing to make enough space for all controls and gui it's big enough to get out of my screen I have a bad effect on my gui like in the image.

2582yz9.png

I suppose it something related to used gui style. The style of window is:

BitXOR($WS_OVERLAPPEDWINDOW,$WS_MINIMIZEBOX,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME)

 

 

Posted

AutoIt internally does lots of processing when you resize windows. If you don't care much about what AutoIt want to do with controls then you can register WM_SIZE and do youur own processing there when sizing happens. I'm doing that in my script.

♡♡♡

.

eMyvnE

  • 1 year later...
Posted

I did it already but unfortunately this don't prevent this problem. Anyway thanks for your help, I'm pretty sure I'll find soon a solution for this problem. :)

 

Hello all / Andreik,

i know it´s long ago, but I have now exactly the same problem. Do you find a solution for this problem?

Posted

Thank you it works but now I'm confused. Based on what it's calculated the height of the ribbon? I have a windows that cannot be resized and the ribbon is 146 px height on (readed in _MyUIApp_OnViewChange and with AutoIt Info Tool, same value no matter used machine) but on different machines, the appearance is not the same.

snc3ed.png   35c3ml4.png

LE: I forgot to mention how other controls are created.

The controls are created at positions based on ribbon height + an offset. For example the most left label that surround the treeview it located at position 150 (146 ribbon height + 4px).

 

I found out the problem yesterday. The problem is the AERO-Style from Windows. If AERO is active, the controls are fitting perfect in the GUI.

  • 10 months later...
  • 9 months later...
Posted (edited)

Looking through MSDN documentation I tried to create different groups of buttons with ControlGroup element but for some reason all my examples fail to compile except the example from MSDN. So I think I miss something but for some reason it's not obviously exactly what.

Here is the MSDN XML markup:

<Group CommandName="cmdSizeDefinitionsGroup"
       SizeDefinition="ButtonGroups">
  <!-- Row 1 -->
  <ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton1" />
      <Button CommandName="cmdSDButton2" />
      <Button CommandName="cmdSDButton3" />
      <Button CommandName="cmdSDButton4" />
      <Button CommandName="cmdSDButton5" />
      <Button CommandName="cmdSDButton6" />
      <Button CommandName="cmdSDButton7" />
      <Button CommandName="cmdSDButton8" />
      <Button CommandName="cmdSDButton9" />
      <Button CommandName="cmdSDButton10" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton11" />
      <Button CommandName="cmdSDButton12" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton13" />
      <Button CommandName="cmdSDButton14" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton15" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton16" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton17" />
      <Button CommandName="cmdSDButton18" />
    </ControlGroup>
  </ControlGroup>
  <!-- Row 2 -->
  <ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton19" />
      <Button CommandName="cmdSDButton20" />
      <Button CommandName="cmdSDButton21" />
      <Button CommandName="cmdSDButton22" />
      <Button CommandName="cmdSDButton23" />
      <Button CommandName="cmdSDButton24" />
      <Button CommandName="cmdSDButton25" />
      <Button CommandName="cmdSDButton26" />
      <Button CommandName="cmdSDButton27" />
      <Button CommandName="cmdSDButton28" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton29" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton30" />
      <Button CommandName="cmdSDButton31" />
    </ControlGroup>
  </ControlGroup>
  <Button CommandName="cmdSDButton32" />            
</Group>

And this is the result:

IC510686.png

You can see how buttons from the first row are groups of 10, 2, 2, 1, 1, 2 buttons.

Well if I try to group the buttons from the first line in groups of 10, 2, 2, 2, 2 then I need to put button15 and button16 in the same control group and the XML should look like below:

<Group CommandName="cmdSizeDefinitionsGroup"
       SizeDefinition="ButtonGroups">
  <!-- Row 1 -->
  <ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton1" />
      <Button CommandName="cmdSDButton2" />
      <Button CommandName="cmdSDButton3" />
      <Button CommandName="cmdSDButton4" />
      <Button CommandName="cmdSDButton5" />
      <Button CommandName="cmdSDButton6" />
      <Button CommandName="cmdSDButton7" />
      <Button CommandName="cmdSDButton8" />
      <Button CommandName="cmdSDButton9" />
      <Button CommandName="cmdSDButton10" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton11" />
      <Button CommandName="cmdSDButton12" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton13" />
      <Button CommandName="cmdSDButton14" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton15" />
      <Button CommandName="cmdSDButton16" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton17" />
      <Button CommandName="cmdSDButton18" />
    </ControlGroup>
  </ControlGroup>
  <!-- Row 2 -->
  <ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton19" />
      <Button CommandName="cmdSDButton20" />
      <Button CommandName="cmdSDButton21" />
      <Button CommandName="cmdSDButton22" />
      <Button CommandName="cmdSDButton23" />
      <Button CommandName="cmdSDButton24" />
      <Button CommandName="cmdSDButton25" />
      <Button CommandName="cmdSDButton26" />
      <Button CommandName="cmdSDButton27" />
      <Button CommandName="cmdSDButton28" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton29" />
    </ControlGroup>
    <ControlGroup>
      <Button CommandName="cmdSDButton30" />
      <Button CommandName="cmdSDButton31" />
    </ControlGroup>
  </ControlGroup>
  <Button CommandName="cmdSDButton32" />            
</Group>

 

And when I try to compile I got this errors:

error SC1032 : Group contains too many controls for the chosen SizeDefinition.
error SC1032 : Group contains too many controls for the chosen SizeDefinition.
error SC1012 : Unable to determine mapping of elements for Group to SizeDefinition 'ButtonGroups'.
error SC1009 : Unable to apply Group.SizeDefinition property 'ButtonGroups'.

These errors makes no sense for me since I didn't add anything to group so I still have 32 buttons but in another configuration. Any help is appreciated.

Edited by Andreik
typo
  • 4 years later...
  • 2 years later...
Posted
On 5/3/2011 at 9:29 AM, taietel said:

UEZ, download the free version of VRC from here and make a custom one. Trancexx, thanks! 5*

Translated from German with Google Translator

Hello!

Actually, you don't dig up old threads. But this thread is the only one on the internet dealing with the ribbon in AutoIt. Unfortunately, the VRC site is no longer active. Can someone make the program available here, or know of an alternative to it? Thanks!

Greetings, Rene

Posted
30 minutes ago, argumentum said:

I believe that he's looking for this

Yes. Thanks! First I have to install the C++ compiler and the Windows 7 SDK. I hope the SDK runs on Windows 11.

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
  • Recently Browsing   0 members

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