Note, this is for windows driver.

/Robert


2012/11/20 Robert Persson <[email protected]>

> I have some new input on the topic of slugish visual feedback for buttons
> that are clicked quickly. I've noticed that buttons that has CANFOCUS=NO do
> not suffer from this problem. I've created a small program to demonstrate
> the problem. There are two buttons in the window, when BUTTON_CB is called
> their TITLE changes to the status string. When they are clicked in a way,
> that the status contains a 'd' (doubleclick), one of the buttons look
> pushed down, and the other do not.
>
> From what I heard from other IUP users, this problem is not only for
> IupButton:s but for some other controls as well, for example toggles.
>
> Code below.
>
> /Robert
>
> /////////// Code start
>
> #include <iup.h>
> #include <string.h>
> #include <stdio.h>
>
> int btncb(Ihandle* ih,int button,int pressed,int x,int y,char* status) {
>     char buf[200];
>
>     sprintf(buf,"Status = '");
>     strcat(buf,status);
>     strcat(buf,"'");
>
>     IupSetAttribute(ih,"TITLE",buf);
>
>     return IUP_DEFAULT;
> }
>
> int main(int argc, char* argv[]) {
>     Ihandle*dlg,*btn1,*btn2;
>     IupOpen(0,0);
>
>     dlg=IupDialog(
>         IupVbox(
>             IupLabel("Double click buttons, but do not release mouse
> button on second click."),
>             IupLabel("The button that can not focus looks 'Down' as
> expected."),
>             IupLabel("The button that cannot focus does not look
> pressed,"),
>             IupLabel("which makes a slugish feedback feeling for"),
>             IupLabel("buttons that are to be pressed multiple times
> quickly."),
>
>             IupLabel(""),
>             IupLabel("This button can focus:"),
>             btn1=IupButton("Status = '          '",0),
>             IupLabel(""),
>             IupLabel("This button can not focus:"),
>             btn2=IupButton("Status = '          '",0),
>             0
>         )
>     );
>
>     IupSetAttribute(dlg,"TITLE","Dbl click bug demonstration");
>     IupSetAttribute(dlg,"MARGIN","16x16");
>     IupSetAttributes(btn1,"EXPAND=HORIZONTAL");
>     IupSetAttributes(btn2,"CANFOCUS=NO,EXPAND=HORIZONTAL");
>     IupSetCallback(btn1,"BUTTON_CB",(Icallback)btncb);
>     IupSetCallback(btn2,"BUTTON_CB",(Icallback)btncb);
>
>     IupShow(dlg);
>
>     IupMainLoop();
>
> }
>
>
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to