Delphi and Toolbar Buttons

Hi,
I just wrote a C3PO with Dephi 2010. Extending the Tools Menu for my function was easy, but I'm still trying to add a toolbar button.
Here is a snip from the code:
function CommandFactory.CustomizeToolBar(const Context: WideString;
GWToolbar: OleVariant): WordBool;
var
Button: variant;
ToolbarItems: variant;
Cmd: Command;
begin
ToolbarItems := GWToolbar.ToolbarItems; // get toolbar items
// MessageBox(0, pwidechar(getCurrentDir) , 'EMAStart', MB_SETFOREGROUND);
If Pos(widestring('GW.CLIENT'), Context) <> 0 then // see if the context is GW.CLIENT or any sub class
begin
GwCmdEMAStart := Command.CreateWithID(EMAStart); // create command for toolbar
Button := GWToolbar.ToolbarItems.Add('Start EMA', GwCmdEMAStart as IGWCommand); // add new Button
GwCmdEMAStart.ToolTp := 'Start EMA tooltip'; // set tooltip for toolbar item
Button.SetBitmap(GetCurrentDir+'\EMAStart.dll','IC ON1'); // set toolbar bitmap
// Button.SetBitmap(GetCurrentDir+'\icons.dll','BUTTO N_1'); // set toolbar bitmap
//C3PO WIZARD icons.dll can be replaced with the full path name of any .exe or .dll that have both 16x16 and 32x32 pixel bitmap
// BUTTON_1 can be replaced with the name of the bitmap contained in the .exe or .dll
end;
result := FALSE;
end;
I included the icon in 16x16, 24x24,32x32 and 48x48 sizes in the ressources..
When I change to the icons.dll (currently commented out) the button appears in the toolbar.
But I never managed to get my button to display.
What's wrong ?
Thanks a lot
Rainer

I've found the solution by myself: You have to include a BITMAP, not an ICON. Including a BITMAP ressource in Delphi 2010 is quite easy: just add it to your project.
Rainer
>>> Rainer Backes<[email protected]> schrieb am 11.08.2010 um 13:39 in Nachricht <[email protected]>:
Hi,
I just wrote a C3PO with Dephi 2010. Extending the Tools Menu for my function was easy, but I'm still trying to add a toolbar button.
Here is a snip from the code:
function CommandFactory.CustomizeToolBar(const Context: WideString;
GWToolbar: OleVariant): WordBool;
var
Button: variant;
ToolbarItems: variant;
Cmd: Command;
begin
ToolbarItems := GWToolbar.ToolbarItems; // get toolbar items
// MessageBox(0, pwidechar(getCurrentDir) , 'EMAStart', MB_SETFOREGROUND);
If Pos(widestring('GW.CLIENT'), Context) <> 0 then // see if the context is GW.CLIENT or any sub class
begin
GwCmdEMAStart := Command.CreateWithID(EMAStart); // create command for toolbar
Button := GWToolbar.ToolbarItems.Add('Start EMA', GwCmdEMAStart as IGWCommand); // add new Button
GwCmdEMAStart.ToolTp := 'Start EMA tooltip'; // set tooltip for toolbar item
Button.SetBitmap(GetCurrentDir+'\EMAStart.dll','IC ON1'); // set toolbar bitmap
// Button.SetBitmap(GetCurrentDir+'\icons.dll','BUTTO N_1'); // set toolbar bitmap
//C3PO WIZARD icons.dll can be replaced with the full path name of any .exe or .dll that have both 16x16 and 32x32 pixel bitmap
// BUTTON_1 can be replaced with the name of the bitmap contained in the .exe or .dll
end;
result := FALSE;
end;
I included the icon in 16x16, 24x24,32x32 and 48x48 sizes in the ressources..
When I change to the icons.dll (currently commented out) the button appears in the toolbar.
But I never managed to get my button to display.
What's wrong ?
Thanks a lot
Rainer

Similar Messages

  • Why are my header icons and toolbar buttons grayed out?

    I purchased a used Macbook Pro from ebay.  Appeared to be in good working order when I first started working with it, but I have updated from OS X 10.9.2 to 10.9.5 and downloaded Open Office program, set up my mail and went through the system preferences and personalized it.  Also ran disk utilities.  Then, this AM, when I restarted, the header icons on the right side are grayed out except for the battery %, the date and time and notifications.  Also, in mail and safari, the toolbar buttons are blank (forward, back, print, mail, bookmarks, autofil, history and downloads).  What happened?  I went to the disk utility from the recovery partition (repaired disk and disk permissions).  I also reset parameters.  Don't know what to do next.  Not sure if this is a hardware or software problem, but I am assuming it is software (OS X) related at this point.  Please help.

      Start up in Safe Mode.
      http://support.apple.com/kb/PH14204?viewlocale=en_US
    Giving away / Selling your Mac / Resetting  the computer to the factory condition
    http://support.apple.com/kb/HT5189
    http://www.thesafemac.com/how-to-prepare-your-mac-for-sale/

  • InDesign Cs5.5 Scrollbar, palettes, and toolbar buttons locked up (but not all)

    Can anyone help me?? I have InDesign as part of Cs5.5. My scrolbars, palettes, and many toolbar buttons aren't working. I can't select the Selection tool, text wrap options, or put color to shapes as just some examples. I have looked all over the forums and web for help and can't find anything. I reset my preferences and reinstalled InDesign. My computer meets the requirements and I am running Windows Vista.

    OMG! Peter you are a LIFE SAVER!!!!!!! I've been trying to figure this out for 4 days!  such a quick response too. Next time I won't wait so long to post a question. seriously though THANK YOU! =-)

  • Right click edit gone and toolbar buttons are black and white, HELP! CS6 Dreamweaver, post update.

    Right click to edit is gone and buttons are grayscale in CS6 Dreamweaver. Between yesterday and today my toolbar buttons went from color to grayscale and my ability to right click code and choose edit is gone. I did the update they pushed out. Ideas?

    The Creative Cloud version of DW changed a bunch of stuff, I think the Edit Tag dialogue was one of them. Here's a few links discussing the changes...
    http://helpx.adobe.com/content/help/en/dreamweaver/using/changes-insert-options-creative-c loud.html
    http://blogs.adobe.com/dreamweaver/2012/10/dreamweaver-creative-cloud-update-12-1-faqs.htm l

  • System Preferences Toolbar and Toolbar Button have disappeared

    My Systems Preferences toolbar disappeared, and so did the small button in the upper right that toggled the toolbar off and on. Any ideas on how to fix this without reinstalling OS X?
    I do not know when the toolbar disappeared (I don't change preferences often), and I do not know if any specific actions or software installations/upgrades caused the problem.

    iTBotB,
    Welcome to Apple Discussions.
    Quit System Preferences (if it's running) and trash the following file: Macintosh HD/Users/username/Library/Caches/com.apple.preferencepanes.cache
    Then launch System Preferences again and check for functionality.
    There is no toolbar button on the System Preferences window. My toolbar only has the following selections: ←/→, "Show All," and a "Search" field.
    ;~)

  • Accessing Internal Names for ToolBar Buttons

    Hi,
    I'm trying to access three toolbar buttons [Movie Tool, 3D Tool, and TouchUp Object Tool]. In order for me to execute these toolbar buttons I need to know their corresponding internal names.
    There is a general list of Toolbar Buttons [such as Advanced Editing, Tools, File, ...] in the Developer Guide, but again it did not mention anything about the three above.
    If anyone could help me out as to what the internal names of Movie, 3D, and TouchUp Tools, I would really appreciate it.
    I'm developing an application in C++ using OLE to Remotely control Adobe Acrobat 3D. So I need to access these specific toolbar buttons for my application.
    Any help would be great.
    Thanks in advance.

    Hi miniCooper,
    Here are a couple resources for you that provide how to create easier to digest reports listing Acrobat's Menu Item and Toolbar button names-
    1.
    This page has a free tool for creating a report with the names in an easy to read format -scroll down to the item "Menu Item and Toolbar button Report Generator."
    2. This article
    Executing Acrobat Menu Items from JavaScript describes how to list Menu Item names but you can substitute app.listToolbarButtons in place of app.listMenuItems to get results for toolbar buttons instead.
    Hope this helps,
    Dimitri
    WindJack Solutions
    www.windjack.com

  • Toolbar button is disappearing when clicked table's row

    Hi
    I use jdeveloper Studio Edition Version 11.1.1.3.0,Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660 .
    I have problem about click table row that surround with panel collection.I tested my small application on explorer 8.When I click the table's row ,table moves up and toolbar buttons disapper.How can I solve this problem.
    Can anybody give suggestions.
    Thks

    I use jdeveloper Studio Edition Version 11.1.1.3.0,Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660 .
    I my little project I use <af:inputListOfValues component.It works well but I want resize popUp window that opened by this component.How can I do it?

  • My back button and refresh button and my yahoo tool bar are dimmed a lot when I open up firefox. So as a result, I cannot use the back button nor my refresh button AND my yahoo toolbar disappears a lot. I have tried to get on your chat session but it is a

    <blockquote>Locked by Moderator as a duplicate/re-post.
    Please continue the discussion in this thread: [/forum/1/688252]
    Thanks - c</blockquote>
    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    My back button and refresh button and my yahoo tool bar are dimmed a lot when I open up firefox. So as a result, I cannot use the back button nor my refresh button AND my yahoo toolbar disappears a lot. I have tried to get on your chat session but it is always closed. I need one on one help. Please reply with resolution.
    == This happened
    ==
    Every time Firefox opened
    == two or three months ago
    ==
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows XP
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 (BT-canvas) Firefox/3.6.3 GTB7.0 (.NET CLR 3.5.30729)
    == Plugins installed
    ==
    *-npdnu
    *npdnupdater2
    *Coupons, Inc. Coupon Printer DLL
    *Coupons, Inc. Coupon Printer Plugin
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    *6.0.12.448
    *RealPlayer(tm) LiveConnect-Enabled Plug-In
    *RealJukebox Netscape Plugin
    *Default Plug-in
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.2"
    *BrowserPlus -- Improve your browser! -- http://browserplus.yahoo.com/
    *Shockwave Flash 10.0 r45
    *Yahoo Application State Plugin version 1.0.0.7
    *3.0.50106.0
    *My Web Search Plugin Stub for 32-bit Windows
    *Google Updater pluginhttp://pack.google.com/
    *Google Update
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    *Npdsplay dll

    * If the menu bar is hidden then press and hold the Alt key down, that should make the Menu bar appear (Firefox 3.6 on Windows) (see [[Menu bar is missing]]).
    * Make sure that you have the ''Navigation Toolbar'' and other toolbars visible: View > Toolbars .
    * If items are missing then see if you can find them in the View > Toolbars > Customize window.
    * If you see the item in the Customize window then drag it back from the Customize window to the Navigation toolbar.
    * If you do not see that item then click the Restore Default Set button in the View > Toolbars > Customize window.
    See also [[Back and forward or other toolbar buttons are missing]] and [[Navigation Toolbar items]]
    See http://kb.mozillazine.org/Toolbar_customization

  • Issue with custom toolbar button in alv and leave screen

    Hi,
    in one subscreen (say screen 100)i have an alv with custom ADD  toolbar button..so in the user_command event handler ,i call a antoher screen(dialogue)..like if i click on ADD button ,it should display dialogue screen(say 200) and after entering input in dialogue screen i click on CONINUE to retrun to screen 100..problem is for the first time i click on ADD button its working fine ,succesffyuly returned to screen 100...but for the second time i click on add button , i have to click on twice the CONTINUE button to retrun to screen 100..when debuggin i found the user_command event routin is executin twice ..any solution..
    Thanks,
    srini

    Apparently handler is set for every new ALV instance. This you get by executing CREATE OBJECT alv... every time PBO is raised. Ensure you are executing this statement only once duirng program lifetime. Then the system will match event handler only with one ALV instance (executing it once).
    if r_alv is not bound.
       CREATE OBJECT r_alv ...
       SET HANDLER ...
    endif.
    Regards
    Marcin

  • I was messing with the computer, not sure what i hit but now all my toolbars at the top of the screen are gone? (file, edit, history, tools and my forward and back button). Please help me get these settings back to the way they were?

    My file, edit, view, history, bookmarks, tools, and help buttons at the top of the screen are gone, along with my forward and back button.

    For details of how to restore it, see https://support.mozilla.com/kb/menu+bar+is+missing
    Once the menu bar is restored, you can use the Toolbars entry in the View menu to restore other toolbars such as the navigation toolbar.

  • How can you add your own print and export buttons to the CR viewer toolbar?

    I posted a previous question that was asking how to get around the Information Bar in IE7 when you export and print.  Unfortunately the CR viewer file download code gets blocked by IE7 because the buttons don't directly download the file.  However, I have been able to get a regular button that calls the following code and streams the file to the client and IE7 does not block it. 
    Sub PrintPDF(sender As Object, e As System.EventArgs)
         Dim crReportDocument as ReportDocument
         Dim crExportOptions as ExportOptions
         Dim crDiskFileDestinationOptions as DiskFileDestinationOptions
         Dim Fname as string
         CrReportDocument = New ReportDocument()
         CrReportDocument.Load(Server.MapPath("estactionlist.rpt"))
         Fname = Server.MapPath("./") & Session.SessionID.ToString & ".pdf"
         CrDiskFileDestinationOptions = New DiskFileDestinationOptions()
         CrDiskFileDestinationOptions.DiskFileName = FName
         CrExportOptions = crReportDocument.ExportOptions
         With crExportOptions
              .DestinationOptions = CrDiskFileDestinationOptions
              .ExportDestinationType = ExportDestinationType.DiskFile
              .ExportFormatType = ExportFormatType.PortableDocFormat
         End With
         CrReportDocument.Export()
         Response.ClearContent()
         Response.ClearHeaders()
                    Response.AddHeader("content-disposition", "attachment;filename=test.pdf")
                    Response.ContentType = "application/pdf"
                    Response.Charset = ""
                    Response.WriteFile(Fname)
                    Response.Flush()
         Response.Close()
         System.IO.File.Delete(Fname)
    End Sub
    So here are my questions?
    1. Is it possible to add a custom print control/icon to the CR viewer toolbar?
    2. If one is not possible, then is it possible to override the CR viewer print and export buttons with your own subroutines like the one above?
    I just want my page to look nice and hate to have print and export buttons outside of my CR viewer. 
    Thanks,
    Kevin

    It might be possible to replace the buttons in a windows app since you can retrieve the toolbar as a toolbar object in the winform viewer  ( ToolStrip toolBar = (ToolStrip) crystalReportViewer1.Controls[3]; )  however with a web app, it's a lot more difficult.
    The problem is that that you need to parse the Request string to try and figure out if the print / export button was clicked.  The code below makes the print button disappear if you click it, so you should be able to modify it to call your custom printing / exporting code instead  (You have to do this check in a postback)
            Dim I As Integer = 0
            If Request.Form.AllKeys.Length > 0 Then
                For I = 0 To Request.Form.AllKeys.Length - 1
                    Response.Write(Request.Form.Keys(I).ToString & "<BR>")
                    If Request.Form.Keys(I).ToString = "CrystalReportViewer2:_ctl2:_ctl2.x" Then
                        CrystalReportViewer2.HasPrintButton = False
                    End If
                Next
           End If
    Shawn

  • My refresh button will not appear in 4.0, all I can get is a stop and home button, the refresh shows up in customize toolbar and I can put it up there, but as soon as I close it it dissapears, how do I get my beloved refresh button to show up?

    At first I had the stop/refresh buttons merged, which I hated so I tried putting spaces and things between them to stop their unholy union, but instead it has now made my refresh button dissapear in anger for not being allowed to see that dirty stop button! I cannot make it come back! Even if I put it on the toolbar in customize and it shows up, the moment I close it it has gone again.

    Firefox 4 uses a combined Stop/Reload/Go button that is positioned at the right end of the location bar.<br />
    During the page load process it shows as a Stop button and after the loading has finished the button is changed to a Reload button.<br />
    If you type in the location bar then that button becomes a Go button.<br />
    You can middle-click that Reload button to duplicate the current tab to a new tab.
    To move the Stop and Reload buttons to their position to the left of the location bar you can use these steps:
    * Open the "View > Toolbars > Customize" window to move the Stop and Reload button out of the location bar.
    * Drag the Reload and Stop buttons to their previous position to the left of the location bar.
    * Set the order to "Reload - Stop" to get a combined "Reload/Stop" button.
    * Set the order to "Stop - Reload" or separate them otherwise to get two distinct buttons.
    See also:
    * http://kb.mozillazine.org/Corrupt_localstore.rdf

  • So how do I REALLY get the toolbar buttons to just show icons (and not text)?

    On my Bookmarks toolbar, my bookmarks "buttons" show icon AND text. I just want to show icon, not text. When I go right-click.....customize, the window "customize toolbars" opens. Down in the bottom left corner the "show" option dropdown is already set to "icons" (and only icons). But it's just not so. The toolbar buttons show icons AND text. If I cycle through that dropdown just for kicks, it doesn't change; I can choose "icons (only)" all day long, but the toolbar buttons still show text.

    Either of the following Add-ons allow you to show icons only and/or to have multiple rows on the Bookmarks Toolbar. Set the options on either after installation.
    *Multirow Bookmarks Toolbar Plus - https://addons.mozilla.org/en-US/firefox/addon/multirow-bookmarks-toolbarplus/
    *Roomy Bookmarks Toolbar - https://addons.mozilla.org/en-US/firefox/addon/roomy-bookmarks-toolbar/
    Other - Check your Plugins and update as needed.
    #Check your Plugins - https://www.mozilla.org/en-US/plugincheck/
    #'''''Adobe Shockwave for Director Netscape plug-in, version 11.6.4.634''''' (this old version has security issues)
    #*http://kb.mozillazine.org/Shockwave
    #*Download, save, close all browsers, run the installer you downloaded - http://get.adobe.com/shockwave/thankyou/

  • When I start it up it shows two two nested windows on the screen, has a Firefox yellow tab in the corner, does not display the toolbar bookmarks, the back and forth buttons do not work and there is no page refresh. No clue what is going on.

    Every time I open up Firefox it appears to open two nested and linked windows, each with their own minimize, maximize and close buttons but the both work the same. The homepage does not come up, the back and forth buttons do not work. Both the refresh button and F5 do not work. The Bookmark Toolbar does not show up until I disable it in View and then re-enable it and this causes the outer nested window to disappear or close.

    This issue can be caused by an extension or theme that isn't working properly.
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • Toolbar buttons do not work and are greyed out not allowing me to log in or log out

    I have increasingly been frustrated with firefox not allowing me to log in and or log out of important websites in which i pay my bills online This happens because the toolbar buttons are greyed out. It makes this feature non functional, therefore I have to resort to closing the website page without logging out. Can you tell me how to fix this problem? When i click on the buttons there is no response; its as if they were drawn.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

Maybe you are looking for

  • IMovie 9.0.6 Crashes When Generating Thumbnails or Importing Video

    I just got a new Macbook Pro Retina Display - 16GB RAM, 2.7 GHz quadcore i7, 512 GB SSD. After transferring apps from my old MBP, I tried opening iMovie. When it attempted to render video thumbnails, it crashed. This is repeatable and never fails. Wh

  • Problem with Reader Extension ES

    Hi, I download the eval JBOSS server from the adobe web site and I installed without any problems, I configure also the reader extension Credential trial one. Now I'm trying to assign reader extension rights to a pdf file via the web interface http:/

  • Lsmw error filepath with F4 help

    Hi, I have to download error data from a lsmw. I have to use gui_download at end_of_processing. Now I want to know how I can implement the selection screen for the filepath parameter and attach the f4 help for it. correct answer will be rewarded. reg

  • Can u stream movies from netflix on the iphone 5 on to a tv without a cord?

    Can u stream movies from netflix on the iphone 5 on to a tv without a cord?

  • Approval Service is not listed in Folder's settings option

    Hi, CM Version  : 6.0.2.4.7 For the repository in question, I have activated StateManagement and Properties CM services.  Even after that I  do not see the option 'Approval' in Folder's Settings. Hence I am not able to enable the approval service for