Jump to content

v3.0.103 Unstable - Reloaded


Jon
 Share

Recommended Posts

  • Replies 220
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I've been watching non-GUI related posts till now ( :"> ) so I'm a bit out of the loop in this area .. but did someone say something about trayicon menus .. :(

Will we be able to change the menu on the fly? Specifically: to modify the menu depending on events at runtime?

Here's hoping :ph34r:

Link to comment
Share on other sites

I'm working at the moment on GUI_HIDE and GUI_SHOW for "menus" but ONLY for MENU's, menuitem is not possible at the moment (maybe never...)

Cause there is also a problem with the 'first' keyboard-input.

At the moment there is already GUICtrlSetState() for menuitems available or did you mean something else?

...so long...

Link to comment
Share on other sites

  • Administrators

I'm working at the moment on GUI_HIDE and GUI_SHOW for "menus" but ONLY for MENU's, menuitem is not possible at the moment (maybe never...)

Cause there is also a problem with the 'first' keyboard-input.

At the moment there is already GUICtrlSetState() for menuitems available or did you mean something else?

...so long...

I think he means adding and removing items from menus. Adding is easy, but at the moment as you know removing controls isn't possible due to the way they are accessed and stored (for speed). I'll change the code so that removing controls is possible and then we can see if we can sort something out for menus. I was going to make it possible to delete controls tomorrow anyway. Edited by Jon
Link to comment
Share on other sites

@Jon: could you please take a look at CreateMENUITEM?

I think there is a small bug at the beginning:

...
if (nSubGlobalID == -1)
        hMenu = lpWin->hMenu;
    else 
    {
...

Maybe it should be:

...
if (nSubGlobalID == -1)
        lpCtrl->hMenu = lpWin->hMenu;
    else 
    {
...

cause hMenu alone is never used in this function.

Regards Holger :ph34r:

Edited by Holger
Link to comment
Share on other sites

  • Administrators

I saw in the changelog that you added ControlGethandle but it's not documented.

And I really would like to see the source of AutoIt3 (unstable version).

Did you or can you upload it somewhere?

I'd forgotten all about that function. :)
Link to comment
Share on other sites

  • Administrators

Updated with some fixes from JP and GuiCtrlDelete()

GuiCtrlDelete() works on most the functions except the tree/menu controls...

Devs:

The framework has been added so that controls can be deleted and the memory for controls is only allocated when required. Controls ID are sequential until the maximum number of controls have been created at which point IDs are recycled.

Edited by Jon
Link to comment
Share on other sites

  • Administrators

Updated with some more JP bugfixes. Also fixed a GDI leak :)

The maximum number of controls per window has been raised to 4096 and each control only uses up memory when it is created ;) Yes, 4096 is a stupidly high number but as it doesn't affect performance what the hell :)

Link to comment
Share on other sites

@Jon: how about this addition/change to GUICtrlDelete()?

////////////////////////////////////////////////////////////////////////////////////////////////
// CtrlDelete()
//
////////////////////////////////////////////////////////////////////////////////////////////////

int CGuiBox::CtrlDelete(int nGlobalID)
{
    int            nWinIdx, nCtrlIdx, i;

    if (GlobalIDtoCtrlIndex(nGlobalID, nWinIdx, nCtrlIdx) == false)
        return 0;                                // Control not used
    
    // Some quick access pointers
    GUIWINDOW    *lpWin    = m_Windows[nWinIdx];
    GUICONTROL    *lpCtrl    = lpWin->Ctrl[nCtrlIdx];

    switch (lpCtrl->cType)
    {
        case AUT_GUI_CONTEXTMENU:
            return 0;            // Can't delete these yet

        case AUT_GUI_MENUITEM:
        case AUT_GUI_MENU:
            if (lpCtrl->cType == AUT_GUI_MENU)
                for (i=AUT_GUI_FIRSTCONTROL;i<lpWin->nMaxCtrl;++i)
                    if (lpWin->Ctrl[i]->hMenu == lpCtrl->hMenu && lpWin->Ctrl[i]->cType == AUT_GUI_MENUITEM)
                        DeleteCtrlIndex(lpWin, i);
            
            if (!DeleteMenu(lpCtrl->hMenu,nGlobalID,MF_BYCOMMAND))
                DeleteMenu(lpWin->hMenu,nGlobalID,MF_BYCOMMAND);

            DrawMenuBar(lpWin->hWnd);
            break;

        case AUT_GUI_TREEVIEWITEM:
            SendMessage(lpCtrl->hBuddy,TVM_DELETEITEM,0,(LPARAM)(HTREEITEM)lpCtrl->hItem);
            break;

        case AUT_GUI_TREEVIEW:
            if (lpCtrl->hTvIml != NULL)
                ImageList_Destroy(lpCtrl->hTvIml);
            for (i=AUT_GUI_FIRSTCONTROL;i<lpWin->nMaxCtrl;++i)
                if (lpWin->Ctrl[i]->hBuddy == lpCtrl->hWnd && lpWin->Ctrl[i]->cType == AUT_GUI_TREEVIEWITEM)
                    DeleteCtrlIndex(lpWin, i);
            // cause treeview has normal window handle we run through
        default:
            // For controls that just need a simple DestroyWindow() on their handle

            // Delete the font
            if (lpCtrl->hFont != NULL)
                DeleteObject(lpCtrl->hFont);

            DestroyWindow(lpCtrl->hWnd);

            break;
    }

    // The control has been deleted, now delete the control structure memory
    DeleteCtrlIndex(lpWin, nCtrlIdx);

    return 1;

} // CtrlDelete()

Regards Holger :)

Edited by Holger
Link to comment
Share on other sites

@jon, I have been using the controlcommand LV_ commands for while with great success, and would like to know if you could do any on the TV_ commands. I have had no problems with getting info on the listviews, but would like to see at least TV_SelectItem ItemName

Thanks.

Edited by this-is-me
Who else would I be?
Link to comment
Share on other sites

  • Administrators

@jon, I have been using the controlcommand LV_ commands for while with great success, and would like to know if you could do any on the TV_ commands. I have had no problems with getting info on the listviews, but would like to see at least TV_SelectItem ItemName

Thanks.

It's planned, yeah. When, I have no idea.
Link to comment
Share on other sites

I think he means adding and removing items from menus.  Adding is easy, but at the moment as you know removing controls isn't possible due to the way they are accessed and stored (for speed).  I'll change the code so that removing controls is possible and then we can see if we can sort something out for menus.  I was going to make it possible to delete controls tomorrow anyway.

<{POST_SNAPBACK}>

Here's what I was thinking in more detail ... Tray Icon Interface

:)

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