Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 19 of 19 total
Thread Font Awesome
Wed, Jan 28 2015 5:51 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< One thought though - it might be nice to have them identified by a
textual name (as well as, or instead of, an index integer). That way I can
change theme or something and select "home" rather than selecting 17, which
is home in one theme but delete in the updated theme. >>

They're only handled by name.  Each state in an interface has a unique name,
and that is used to select a given icon from the icon library.  If you look
at the TIcon control (actually, TIconControl), for example, you can see how
this works:

  TIconControl = class(TControl)
     private
        FIcon: String;
        procedure SetIcon(const Value: String);
        function GetIconNames: array of String;
     protected
        property Icon: String read FIcon write SetIcon default ''
           description 'Specifies the name of the icon'
           values GetIconNames;
        function CreateElement: TElement; override;
        procedure UpdateInterfaceState; override;
     end;

And this is what the implementation looks like:

function TIconControl.CreateElement: TElement;
begin
  Result:=InterfaceManager.CreateElement(ICON_ELEMENT_NAME,nil,ELEMENT_CLASS_DIV);
end;

procedure TIconControl.SetIcon(const Value: String);
begin
  if (Value <> FIcon) then
     begin
     if (Value <> '') then
        begin
        if IconLibrary.ApplyIcon(Element,Value) then
           FIcon:=Value;
        end
     else
        begin
        Element.Background.Image.Name:='';
        FIcon:=Value;
        end;
     end;
end;

function TIconControl.GetIconNames: array of String;
begin
  Result:=IconLibrary.GetIconNames;
end;

procedure TIconControl.UpdateInterfaceState;
begin
  { Suppress any interface state changes due to mouse overs, etc. }
end;

The global IconLibrary instance variable is in the WebUI unit, and is
automatically created during initialization.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Jan 29 2015 3:48 AMPermanent Link

Mark Brooks

Slikware

Avatar

"Tim Young [Elevate Software]" wrote:

>>You could work up a control that could display these, but if you use their
>>CSS styles you won't be able to see them at design-time, and you'll be
>>loading a huge CSS file at runtime for pretty much no reason.  It would be
>>much better to treat them as what they are, a font, and use them in the EWB
>>2 icon library as such.  You can use the Font and Content properties to
>>display symbolic font glyphs in any size that you want.  You just have to
>>tell the interface to apply those properties instead of properties like the
>>background image.  I'll see if I can work up an example.

If I understand you correctly Tim, I think this would be an exceptional addition to EWB2. An example would be greatly appreciated. The ability to easily utilise font awesome will make EWB2 apps look incredibly professional.
Thu, Jan 29 2015 4:27 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> << One thought though - it might be nice to have them identified by a
> textual name (as well as, or instead of, an index integer). That way
> I can change theme or something and select "home" rather than
> selecting 17, which is home in one theme but delete in the updated
> theme. >>
>
> They're only handled by name.  Each state in an interface has a
> unique name, and that is used to select a given icon from the icon
> library.  If you look at the TIcon control (actually, TIconControl),
> for example, you can see how this works:

Another "already done that way" - love it.
Thu, Feb 19 2015 8:02 AMPermanent Link

Mark Brooks

Slikware

Avatar

Mark Brooks wrote:

"Tim Young [Elevate Software]" wrote:

>>You could work up a control that could display these, but if you use their
>>CSS styles you won't be able to see them at design-time, and you'll be
>>loading a huge CSS file at runtime for pretty much no reason.  It would be
>>much better to treat them as what they are, a font, and use them in the EWB
>>2 icon library as such.  You can use the Font and Content properties to
>>display symbolic font glyphs in any size that you want.  You just have to
>>tell the interface to apply those properties instead of properties like the
>>background image.  I'll see if I can work up an example.

Tim
Did you get a chance to look at this example? I've returned to this area with view to creating some navigation controls that would use FA for their icons. It's not clear to me how to utilise them.
Thanks
Mark
Thu, Feb 19 2015 9:48 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mark,

<< Did you get a chance to look at this example? >>

I can't do the example until I get the support for web fonts in EWB.  It has
to have the underlying support services for making sure that any web fonts
are mapped properly, and then uploaded along with the application, if
necessary.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Apr 1 2015 4:04 AMPermanent Link

Matthew Jones

Mark Brooks wrote:

> Well maybe Mathew. I haven't looked at that yet. Does it use "font
> characters" as opposed to images? That is the key to font-awesome.

This came across my feed today:

http://blogs.balsamiq.com/product/2015/03/31/font-awesome/

They are using Font Awesome in Balsamiq, which is a mockup tool I've
used in the past. (I now use WebBuilder!)

Strikes me that it wouldn't be hard to do "our own" component to do
this. Go direct to a font and have some sort of selector. I don't have
time to play with this at the moment though...

Matthew
Wed, Apr 1 2015 5:23 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Strikes me that it wouldn't be hard to do "our own" component to do this.
Go direct to a font and have some sort of selector. I don't have time to
play with this at the moment though... >>

The main holdup is still the lack of embedding for the web font reference so
that it gets downloaded properly.  You could just edit the html to include
it, of course, but it won't be much longer to wait for the "real deal".

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Apr 1 2015 5:56 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> The main holdup is still the lack of embedding for the web font
> reference so that it gets downloaded properly.  You could just edit
> the html to include it, of course, but it won't be much longer to
> wait for the "real deal".

Ah, right, so telling the browser using the downloaded HTML to get the
font file. Yes, I can see that would be awkward. Obviously you are "on
it", but the key should of course be to have the enabling facilities,
and then anyone can do what they need. Which is what you are doing of
course.
Wed, Apr 1 2015 9:45 AMPermanent Link

Mark Brooks

Slikware

Avatar

"Tim Young [Elevate Software]" wrote:

>>The main holdup is still the lack of embedding for the web font reference so
>>that it gets downloaded properly.  You could just edit the html to include
>>it, of course, but it won't be much longer to wait for the "real deal".

Tim, I think it goes without saying that this is a MASSIVE feature for me and, I suspect, for most users wanting to quickly and easily build out a modern UI. Coupled with the other EWB2 features and functionality, this really is the icing on the cake. I await the "real deal" with much anticipation.
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image