Beiträge von djouce

    Hi Julian,

    Thanks for the reply. Yes, I have used wpaActions for both the toolbar buttons and combo boxes, as per your manual. You can check this out in the test code I emailed you on 5th October (Subject: "Undo-Redo Problem Sample Code"). It works correctly for buttons, but not for the combo boxes. The problem seems to be specifically related to paragraph-level operations, i.e. if I select text and execute an action on that (such as fontface change), undo is possible, but if for example I apply a paragraph style (as per the above code example), the style is applied correctly, but Undo is not possible.

    I have spent a lot of time experimenting with many variations, including wpaProcess, wpaExec, CurrPar, CurrParAttr, etc., and nothing makes any difference. I've concluded that I must be missing something, but I've decided to cut my losses in this respect and write my own Undo/Redo engine, which is a better solution anyway for my requirements as it gives me more control over implementation. I was hoping to avoid that, but since it's not working out, I'll just get on with what I should have done to begin with :)

    Regards,

    Brian

    Hi Julian.

    I'm using Devcomponents DotNetBar for my user interface, and since there's no way I can make the built-in TextDynamic toolbar emulate the look-and-feel of DNB, a customised toolbar is my only option.

    Mostly, it's a doddle to implement, thanks to the really neat procedures outlined in your manual.

    However, I have run up against one little problem that has defeated all my efforts to solve.

    If I use a drop-down combo box to assign styles (e.g. to paragraphs), everything works fine, with the significant exception that the style change does not register on the undo/redo stacks. Other custom combo-box ops (font-size, font face) do, so the problem looks somewhat specific to this area.

    If on the other hand, I use the built-in combo box to assign the same styles, the style changes do register on the undo/redo stacks, which leaves me wondering what I need to do to achieve the same result.

    Here is the code for my custom combo box:

    Ok, it looks like it should work, but it doesn't, and for the life of me, I can't figure out why. I've tried numerous variations on the above, to no effect.

    I should also mention that it makes no difference whether or not I assign the value "ParStyleSelection" to the Text property of the custom combo, for initialising with InitToolbar().

    Is there any way to ensure ops like this get pushed onto the undo stack, or am I (dear heaven!) going to have to write my own undo/redo engine?

    I'm emailing you two sample projects, one with the default styles combo, and one with my custom combo, so you can see the complete code.

    Thanks,

    Brian

    I've had similar problems, and the solution is a little hard to find, but here it is: in your project properties set the Target CPU to "x86" (VS 2008: Compile->Advanced Compile Options->Target CPU).

    Also, include this line when initialising to ensure the default buttons display:

    Me.WpdllInt.SetLayout("{dll}\\buttons.pcc", "").

    And one more thing: make sure "Copy Local" is set to True in your project reference "WPTDynInt3" properties.

    It should work just fine now.

    FWIW, I've given up on this in the past for various reasons, but I've decided to finally buy because it's the best all-round visual editor out there for the price, IMO, and I've tried them all.