Loading ...
Sorry, an error occurred while loading the content.

Re: [perlguitest] Re: How to click on toolbar's buttons?

Expand Messages
  • Wenjie Wang
    The toolbar itself is dialog based class #32770 (Dialog) with button, combo and other controls. The toolbar is attached to window s rebar. It has more than
    Message 1 of 12 , Jan 10, 2005
    • 0 Attachment
      The toolbar itself is dialog based class "#32770 (Dialog)" with button, combo and other controls. The toolbar is attached to window's rebar.

      It has more than one buttons in the toolbar, and that's why I need to use control ID of the button to distinguish between them.

      Again, control ID of the button control is used when calling PushChildButton function.

      Cheers,
      WWang


      +-Wenjie Wang a.k.a William -------------------------------------+
      | WANG Infonology Systems |EMail : wwang@... |
      | Phone : (02) 9871 2018 | WISeAgent2000@... |
      | Mobile: 0412 688 380 |http://users.bigpond.net.au/WISeAgent |
      +-------------------------+--------------------------------------+

      pkaluski <pkaluski@...> wrote:

      Hmm...
      To be honest I am a little bit surprised that it really worked for
      you. Could you please provide me with more details:
      1. What type of control is it (this toolbar). Is it a common windows
      control?
      2. How many buttons does it have?
      3. How do you select which button to push?

      -Piotr

      --- In perlguitest@yahoogroups.com, Wenjie Wang <wiseagent2000@y...>
      wrote:
      >
      > I've done something similar like following and it's simple and
      works fine with me:
      >
      > my $myToolbar = GetDNACallModeToolbar();
      >
      > if ($myToolbar)
      >
      > {
      >
      > PushChildButton($myToolbar, 1280, 0.3);
      >
      > }
      >
      > Ofcourse I'm testing my own GUI written in MFC and I have knowledge
      of all the control IDs. But you could always use spy++ to find out
      resource ID of toolbar button.
      >






      ---------------------------------
      Yahoo! Groups Links

      To visit your group on the web, go to:
      http://groups.yahoo.com/group/perlguitest/

      To unsubscribe from this group, send an email to:
      perlguitest-unsubscribe@yahoogroups.com

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



      ------------------------------------------------------------------------------------------
      Wenjie Wang(a.k.a. William) wwang@...
      WANG Infonology Systems Ph: (02)-98712018 Mobile: 0412688380
      http://users.bigpond.net.au/WISeAgent http://www.websamba.com/wiseagent
      ==================================================


      ---------------------------------
      Find local movie times and trailers on Yahoo! Movies.


      [Non-text portions of this message have been removed]
    • pkaluski
      Hi, This is a summary response to your last 3 posts (702-704). You are right. I have also observed that for basic controls like Edits, ComboBoxes etc. resource
      Message 2 of 12 , Jan 11, 2005
      • 0 Attachment
        Hi,
        This is a summary response to your last 3 posts (702-704).

        You are right. I have also observed that for basic controls like
        Edits, ComboBoxes etc. resource ID is equal to control ID. However,
        this is only an observation. I haven't found any document saying that
        control id = resource id (if anyone can confirm/deny, please do it).
        From the other hand I have seen controls defined by CONTROL command
        in rc file, which had resource ID != 0 and control ID = 0. You can
        try with VC++. Create a project with application hosting an
        Activex control. You will see the control will have Control ID = 0,
        in the same time having resource id != 0.

        As for handling a toolbar. According to your description you are not
        dealing with the standard toolbar, like ToolbarWindow32 (used in
        Spy++, for example). You deal with a custom made toolbar, which
        is actually a dialog box with button controls on it. For such a case
        you are right - it works and you can select buttons by control ID.
        However, it is not going to work for standart toolbars (present in
        Spy++ or in basic MFC applications created by AppWizard). As you can
        see, there are no children of such a toolbar control. The standard
        control toolbar works this way - you pass it a set of bitmaps which
        should appears as buttons. Toolbar control is resposible for
        notifying you, which button was clicked (when you click on it). You
        can check the link http://msdn.microsoft.com/library/default.asp?
        url=/library/en-
        us/shellcc/platform/commctls/toolbar/toolbar_overview.asp.
        You can also check Jeff's Prosize "Programming Windows with MFC (2nd
        edition)", chapter 12.

        -Piotr


        --- In perlguitest@yahoogroups.com, Wenjie Wang <wiseagent2000@y...>
        wrote:
        >
        > The toolbar itself is dialog based class "#32770 (Dialog)" with
        button, combo and other controls. The toolbar is attached to
        window's rebar.
        >
        > It has more than one buttons in the toolbar, and that's why I need
        to use control ID of the button to distinguish between them.
        >
        > Again, control ID of the button control is used when calling
        PushChildButton function.
      • wenjie wang
        ... However, ... that ... it). ... command ... 0, ... not ... case ... can ... which ... You ... (2nd ... Thanks for the summary. It has presented a better
        Message 3 of 12 , Jan 11, 2005
        • 0 Attachment
          --- In perlguitest@yahoogroups.com, "pkaluski" <pkaluski@p...> wrote:
          >
          > Hi,
          > This is a summary response to your last 3 posts (702-704).
          >
          > You are right. I have also observed that for basic controls like
          > Edits, ComboBoxes etc. resource ID is equal to control ID.
          However,
          > this is only an observation. I haven't found any document saying
          that
          > control id = resource id (if anyone can confirm/deny, please do
          it).
          > From the other hand I have seen controls defined by CONTROL
          command
          > in rc file, which had resource ID != 0 and control ID = 0. You can
          > try with VC++. Create a project with application hosting an
          > Activex control. You will see the control will have Control ID =
          0,
          > in the same time having resource id != 0.
          >
          > As for handling a toolbar. According to your description you are
          not
          > dealing with the standard toolbar, like ToolbarWindow32 (used in
          > Spy++, for example). You deal with a custom made toolbar, which
          > is actually a dialog box with button controls on it. For such a
          case
          > you are right - it works and you can select buttons by control ID.
          > However, it is not going to work for standart toolbars (present in
          > Spy++ or in basic MFC applications created by AppWizard). As you
          can
          > see, there are no children of such a toolbar control. The standard
          > control toolbar works this way - you pass it a set of bitmaps
          which
          > should appears as buttons. Toolbar control is resposible for
          > notifying you, which button was clicked (when you click on it).
          You
          > can check the link http://msdn.microsoft.com/library/default.asp?
          > url=/library/en-
          > us/shellcc/platform/commctls/toolbar/toolbar_overview.asp.
          > You can also check Jeff's Prosize "Programming Windows with MFC
          (2nd
          > edition)", chapter 12.
          >

          Thanks for the summary. It has presented a better picture of our
          discussion.

          As far as GUI concern, I'm mainly using win32 API / MFC / ATL. I'm
          using PERL for other purpose. It happened that I have to perform
          automated GUI manipulation in one of my new project and GuiTest
          module is picked for the project. I haven't spent much time
          investigating it futher till I read your comments in your web site.
          and then dive into guitest.pm;-)

          Luckily, what I've done so far is valid and works fine for my
          project.

          Regards
          W Wang

          +-Wenjie Wang a.k.a William -------------------------------------+
          | WANG Infonology Systems |EMail : wwang@... |
          | Phone : (02) 9871 2018 | WISeAgent2000@... |
          | Mobile: 0412 688 380 |http://users.bigpond.net.au/WISeAgent |
          +-------------------------+--------------------------------------+
        Your message has been successfully submitted and would be delivered to recipients shortly.