Jump to content
Sign in to follow this  
lynkfs

ionic

Recommended Posts

Usually I try to steer away from external frameworks. They seldom provide exactly what is needed and are difficult to modify.

An exception may be the ionic framework. It is an open source ui toolkit with some nice elements in it. The good thing is that their components subtly change depending on which platform they are used on.

The following code uses 2 Ionic components : a button and an extremely elegant selector

  var iobutton : TIonicButton := TIonicButton.Create(self);
  iobutton.setbounds(100,100,100,35);
  iobutton.color := 'primary';
  iobutton.fill := 'outline';
  iobutton.caption := 'mybutton';
  iobutton.onclick := procedure(sender:TObject)
    begin
      showmessage((sender as TIonicButton).caption);
    end;
  end);

and the selector

  var iofab : TIonicFab := TIonicFab.Create(self);
  iofab.setbounds(400,200,56,56);

  iofab.mainIcon   := 'share';
  iofab.topIcon    := 'logo-vimeo';
  iofab.bottomIcon := 'logo-facebook';
  iofab.leftIcon   := 'logo-instagram';
  iofab.rightIcon  := 'logo-twitter';

  iofab.right.button.onclick := lambda showmessage('twitter'); end;

See demo here

 

The code for both the button and the selector component in unit2/3 of this project

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...