• 0

    posted a message on AceConfig3 - Accessing the widgets
    Having a bit of trouble with the AceGUI.FocusedWidget. This is what my function looks like :

    [PHP]

    local AceGUI = LibStub("AceGUI-3.0")

    hooksecurefunc("SpellButton_OnModifiedClick", function(self, button)

    local id = SpellBook_GetSpellID(self:GetID());
    if ( id > MAX_SPELLS ) then
    return;
    end
    if ( IsModifiedClick("CHATLINK") ) then
    if ( AceGUI.FocusedWidget ) then


    local spellName, subSpellName = GetSpellName(id, SpellBookFrame.bookType);
    local self = AceGUI.FocusedWidget
    if ( spellName and not IsPassiveSpell(id, SpellBookFrame.bookType) ) then
    if ( subSpellName and (strlen(subSpellName) > 0) ) then
    self:Insert(spellName.."("..subSpellName..")");
    else
    self:Insert(spellName)
    end
    end

    end
    end

    if ( IsModifiedClick("PICKUPACTION") ) then
    PickupSpell(id, SpellBookFrame.bookType);
    return;
    end

    end)[/PHP]

    AceGUI.FocusedWidget always seems to return nil. Am I doing something incorrectly?
    Posted in: Ace3
  • 0

    posted a message on AceConfig3 - Accessing the widgets
    Cool, Thanks for pointing that out to me, and thanks everyone for all the help you've given me

    - Warcrazy
    Posted in: Ace3
  • 0

    posted a message on AceConfig3 - Accessing the widgets
    Ya, I kind of figured I was forcing something to work that really shouldn't (wasn't aware of how widgets were recycled either). This is basically what I implemented to solve my shift-click/editbox problem described a couple posts back:

    this:SetScript("OnMouseDown", function() myAddon.selected = this end)

    and later on -

    local self = myAddon.selected
    self:SetText(self:GetText()..spellName)

    This works well (aesthetically at least), but if it is dangerous to AceConfig / AceGUI's widget system, I'd definitely scrap the idea.

    Assuming there's no way to accomplish something like this safely with just AceConfig, how might I use the direct approach with AceGUI? Could I place the custom widgets within a window generated via AceConfig with generic AceConfig widgets?

    If someone could possibly point me to some documentation or an ace addon that does something similar to this, I'd be glad to do some research on it for myself, just having a bit of trouble finding a starting point :)

    EDIT - Just one more quick thought. What if I were to get rid of the Script handler when I am done with it via ' this:SetScript("OnMouseDown", nil) '? Would it still cause issues?

    Thanks so much for all the help so far,

    - Warcrazy
    Posted in: Ace3
  • 0

    posted a message on AceConfig3 - Accessing the widgets
    After messing around with this a bit, I think I kinda found a way to do it. Using the 'input' widget as an example, its set, get, and name arguments are passed 'this' when called. Because of this, you could do something like the below :

    [PHP]example = {
    order = -100,
    type = 'input',
    name = function()

    this:SetScript("OnEnter", function() message('OnEnter') end)
    return 'example'

    end,
    set = function() blah end,
    get = function() blah end
    }[/PHP]

    After mousing over the widget a time or two (forcing the example.name function to be called), the new OnEnter function is called as opposed to the description tooltip popping up. This isn't exactly ideal but seems to get the job done.

    This sort of thing is probably a bit above what AceConfig was built to do, but It'd be awesome to maybe have a an some sort of init method added to possible arguments for AceConfig widgets and called when the widget was ready for use. Something like this maybe ;

    [PHP]aWidget = {

    type = "input"
    init = function(self)

    self:method()
    ...
    return self

    end,

    other args

    }[/PHP]
    Posted in: Ace3
  • 0

    posted a message on AceConfig3 - Accessing the widgets
    ah, ok was afraid of that. The reason I ask is that I am trying to allow the user to shift-click an item or spell into an editbox and to do that I believe I'd need some kind of indication which editbox that there cursor is in. If there is a way to kinda make this work that anyone knows of, I'd love to hear any ideas. Thanks so much for all those who've responded so far,

    - Warcrazy
    Posted in: Ace3
  • 0

    posted a message on AceConfig3 - Accessing the widgets
    Using the above as an example, how might I give ' route_name ' an OnClick Handler. For example :

    [some Object Referring To route_name]:SetScript("OnClick", function()

    code here

    end)

    I am basically trying to get an idea when my editboxe's have focus. I cannot figure out how to do this within the standard handlers provided with AceConfig so I thought perhaps I could put it in manually.
    Posted in: Ace3
  • 0

    posted a message on AceConfig3 - Accessing the widgets
    Hi. I am using AceConfig to build a simple GUI for an addon. However, I am not exactly sure how to access the individual widgets for calling methods etc. For example, If I have an editbox (or 'insert' as AceConfig calls it) and want to give it an OnClick handler how might I go about doing that?

    I've tried a couple of things such as myOptionsTable.args.testInput:[Method Here] but this doesn't seem to work. Is this possible with AceConfig? Any input is much appreciated, Thanks.

    - Warcrazy
    Posted in: Ace3
  • 0

    posted a message on AceConfig-3.0 - Creating a GUI in a stand-alone windo
    ah, that makes sense, thanks to both of you for the quick replies
    Posted in: Ace3
  • 0

    posted a message on AceConfig-3.0 - Creating a GUI in a stand-alone windo
    Hey,

    I am currently using AceConfig-3.0 to build an addon's GUI (not its options pane but the actual part the user interacts with). Since I am fairly new to building GUIs with Ace / AceConfig, I decided to just put the GUI in the blizz interface options category (using LibStub("AceConfigDialog-3.0"):AddToBlizOptions(...)) temporarily as I learned how the lib worked.

    Now that I've figured out how to build a GUI with AceConfig, I'd like to put that GUI in a stand-alone window (not in blizz's interface menu). Is there perhaps another library that AceConfig can plug into to create its GUI on a separate window? Or perhaps a way to put it on a window I draw manually? I've looked around this site and others to no avail, so I am wondering if anyone can offer me any help or advice to get me going in the right direction.

    Thanks very much,

    Warcrazy
    Posted in: Ace3
  • To post a comment, please or register a new account.