Re: XForms: Text and @ sign - the final step

Michael Glickman (michg@alphalink.com.au)
Thu, 09 Sep 1999 20:17:14 +1000

# To subscribers of the xforms list from Michael Glickman <michg@alphalink.com.au> :

--------------7169D6E7365E93273CD35807
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello Jason

More good news (this time there really are!)

XForms has a function fl_drw_text_cursor
that does NOT interpret @ according to the manual
and in real life (I tested it).

With this function the code becomes as easy
as ... @123 !

--------------------------------------------------
/* Initialization */

fdui->at123_btn =
obj = fl_add_button(FL_NORMAL_BUTTON,
100,100,30,20,"@patch");

/* Setting symbol */
fl_add_symbol("patch", at123_patch_routine, 0);

/* The patch routine */
void at123_patch_routine(FL_COORD x, FL_COORD y,
FL_COORD w, FL_COORD h,
int angle, FL_COLOR col)

{
fl_drw_text_cursor(FL_ALIGN_LEFT | FL_ALIGN_INSIDE,
x, y, w, h, col,
FL_NORMAL_STYLE, FL_NORMAL_SIZE,
"@123", 0, -1);
}

-----------------------------------------------------------

Replace "@123", style and size by anything you wish!

If you have different buttons, you can use the same
symbol with different "angles" (sorry, T.C. for
another trick - hopefully the last).

It has been tested with XForms 0.88.

Good Luck!
Michael

Jason White wrote:

> # To subscribers of the xforms list from Jason White <jdwhite@iastate.edu> :
>
> >> I've been trying to figure out how to display a literal at (@) sign as a
> >> button label using the function fl_set_object_label().
> [...]
> >
> >Add a leading blank:
> >
> > " @"
>
> This solution does keep the forms library from complaining, but the
> space shows up in the label as well which isn't desirable. Any other
> solutions?
>
> -Jason
>

--------------7169D6E7365E93273CD35807
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Hello Jason

More good news (this time there really are!)

XForms has a function fl_drw_text_cursor
that does NOT interpret @ according to the manual
and in real life (I tested it).

With this function the code becomes as easy
as ... @123 !

--------------------------------------------------
 /* Initialization */

  fdui->at123_btn =
    obj = fl_add_button(FL_NORMAL_BUTTON,
                           100,100,30,20,"@patch");

 
 /* Setting symbol  */
   fl_add_symbol("patch", at123_patch_routine, 0);
 

 /* The patch routine */
    void at123_patch_routine(FL_COORD x, FL_COORD y,
                             FL_COORD w, FL_COORD h,
                             int angle, FL_COLOR col)

    {
        fl_drw_text_cursor(FL_ALIGN_LEFT | FL_ALIGN_INSIDE,
                             x, y, w, h, col,
                             FL_NORMAL_STYLE, FL_NORMAL_SIZE,
                             "@123", 0, -1);
    }
 
-----------------------------------------------------------

   Replace "@123", style and size by anything you wish!

    If you have different buttons, you can use the same
    symbol with different "angles" (sorry, T.C. for
    another trick - hopefully the last).

    It has been tested with XForms 0.88.
 
    Good Luck!
    Michael
 
 
 

Jason White wrote:

# To subscribers of the xforms list from Jason White <jdwhite@iastate.edu> :

>>   I've been trying to figure out how to display a literal at (@) sign as a
>> button label using the function fl_set_object_label().
[...]
>
>Add a leading blank:
>
>       " @"

  This solution does keep the forms library from complaining, but the
space shows up in the label as well which isn't desirable.  Any other
solutions?

-Jason
 

--------------7169D6E7365E93273CD35807--

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/