After developing with Firemonkey iOS controls for a month, I really dissapointed with them :( The FMX performance is terrible, so I was very happy when yesterday I found your components :)
I'm so impressed, that I would like to help :)
So I created a sample, what I'm thinking about. As you can see on the screenshot I made the UIButton component to display in DesingTime as it would display on the iOS device :) I tried to keep the code as simple as possible, with a very easy way to add this feature to the other controls. Because now I'm only testing, I made just the UIButton RoundedCorner mode available, but I will make the other ones also.
If you interested in it, I can share the code with you, and it can be integrated into the further editions.
It can make things much easier. I was thinking at a Firemonkey -> DPF NativeIOS converter, where you program using Firemonkey Controls and later, you lauch the conversion. However, this approach is far more better.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm happy to hear you are interested in it. :) Today I was busy with other things, so I just make a little change, but I will continue doing it. (Try to set the ButtonType to btDetailDisclosure)
In the GUI.zip you'll find 2 folders and a font. The font is used by the iOS, but it isnt't necessary. The "Add to framework" folder contains the files I created or modified. You need to add these to the framework. The "Resources" folder contains the additional files that I use to implement the GUI, but these aren't needed to be included in the framework, they are used just for compiling the "Fenistil.iOS_DesignTime.res" file (I compiled it already).
In the "DPF.iOS.UIButton.pas" you will find all the changes if you search for "Fenistil", because I commented all of them I've made. In the future I think I need to implement function more deeply into the framework because of complex controls (like Toolbar, or TableView), so I'll always comment what I've done.
Firstly I will do the simpler controls like Buttons, Edits, Switch, etc. and later the more complex ones. In the most cases I need to add the resources to the control (GUI record in the private section), load these on Create and Free them on Destroy and override the Paint and Resize methods. So you can modify everything else, I will always try to post any new code as soon as possible to you.
I think now you should wait for the Button to be complete and then add it to the newest version of you Button. I think it can be done in about 2 days. So try it out for now, and I will post the new code as soon as it completes.
To standardize source code and file names, please observe file names in the same way,
but you can comment all you functions and procedures you name like:
//----------------------------------------------
// Author: Fenistil
//----------------------------------------------
then, please change :
1)
Fenistil.iOS_DesignTime.Functions.pas
to
DPF.iOS.DesignTime.pas
and put your code with your comments into this file,
2)
Fenistil.iOS_DesignTime.res
to
DPF.iOS.DesignTime.res
3)
Fenistil.iOS_DesignTime.rc
to
DPF.iOS.DesignTime.rc
and comment your name into DPF.iOS.DesignTime.rc file name like above comment.
I aslo share this file (DPF.iOS.DesignTime.rc) into framework
if me or others want to add or change any functions, we can do it any changes on this unit.
Thank you for your good work,
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The button will complete soon, but I think, I can't make the custom Images (like greenButton@2x.png) to work, because the path is not known within the IDE (/Documents/...), only on the device. But I think it isn't a real problem.
I will change the filenames.
If you include the RC file, then you have to include the PNGs as well.
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I applied all the modifications to the 1.8.2 framework and here it is. :)
So as I wrote, the Button, Slider, Stepper and Switch are done. Try them, everything should work fine (change the IsOn property, or set the Value of the slider :))
In the button I can't take in account the new Font property because in Windows there is different font names. If we made a "compatible list" between the windows font names and the ios' ones, then it would be possible to show the button's font correctly in the IDE.
Thank you for your good job,
I see button unit and i think must be have a some changes,
I'm currently working on another classes, and I will apply your good work in source to weekends.
thanks again for your nice work
Last edit: Babak Yaghoobi 2013-07-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1)
One of the changes in fixing size of buttons with button type,
Not be fixed, iOS button can be have system icon (info) and text,
Generally all buttons is flexible and dynamic size, and icons must be left of text (if have a text).
i think you must be change BitmapAsBackground function and pass into bitmap and text then inside function calculate size of text(textWidth) and sum it with bitmap and find center of button and draw first icon then text, ...
firstXForDraw := Max((button.with - (textWidth+iconWidth)) div 2, 0);
Maybe I will change all the bitmap handlings. Now, if the user has 5 buttons, the bitmaps are loaded 5 times. I will move all the bitmaps to the global section of "DPF.iOS.DesignTime.pas", load them in the unit's initialize section, and free then in the finalize. This way I have to load every bitmap only once. That way has the smallest memory footprint, and the faster approach (only 1 LoadResource / bitmap).
Last edit: Fenistil 2013-07-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Changes:
1. Button implementaion corrected for all button types.
2. Button's caption is altered according to the value of TextLineBreak.
3. All bitmaps are moved to the "DPF.iOS.DesignTime.pas" and loaded only once per running Delphi IDE. This way, only two functions need to be changed in the components (Paint, Resize).
Installation, for those who want to try it:
1. Uninstall Native iOS package from IDE if installed.
2. Overwrite the files in your 1.8.2 library with the files in the "Add to Framework" folder in the ZIP.
3. Build "DPFiOSPackagesR.dproj" for Win32, iOS Simulator and iOS Device.
4. Build and Install "DPFiOSPackagesD.dproj" for Win32. Build it for iOS Simulator and iOS Device.
5. Create a mobile app (or load one), put a Button, Slider, Switch or Stepper to the Form.
Changelog:
* 2 new controls: SegmentedControl, DatePicker
Added Invalidate method to the iOSBaseControl class. (Babak, don't forget this, it's important!)
Changed the DatePicker's "SetFPickerDate" to "SetPickerDate" (removed the "F", I think it was a misstype).
The SegmentedControl works completely, you can change the appearance, segments, title, and you'll see everything in the IDE. For this I have to change the TDPFSegmentedControlCollection and TDPFSegmentedControlItem classes.
Added "default" to the Segments, this way you can access them like "SegmentControl1.Segments[0].Title" instead of "SegmentControl1.Segments.Items[0].Title".
Good question... I'd go from simpler controls to the more complex ones, and I think the TableView is one of the most complex ones :D I don't know. Now I make some changes to the DatePicker, then I would like to do the Edit components. This will take some days after that I'll think what to do next. On the other hand I need to wait for the TableView to be completed (added Cell support, etc.), and I need a lot of testing, because it can be very very different, so it will take time. But I'll do it, just wait for it :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I checked the source code of the integrated Designtime components, and you removed a functions that needed:
1. The TDPFSegmentedControlItem.SetTitle is needed, because if you modify the Title of a segment in the Object Inspector, the control doesn't redraw itself until the user go back to the Form designer and click on it or move it. I'll put it back now, please keep it in the source.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Babak!
After developing with Firemonkey iOS controls for a month, I really dissapointed with them :( The FMX performance is terrible, so I was very happy when yesterday I found your components :)
I'm so impressed, that I would like to help :)
So I created a sample, what I'm thinking about. As you can see on the screenshot I made the UIButton component to display in DesingTime as it would display on the iOS device :) I tried to keep the code as simple as possible, with a very easy way to add this feature to the other controls. Because now I'm only testing, I made just the UIButton RoundedCorner mode available, but I will make the other ones also.
If you interested in it, I can share the code with you, and it can be integrated into the further editions.
Regards,
Fenistil
Last edit: Fenistil 2013-07-12
Hi, Fenistil
I'd be happy هf you or other friends can do to help, this is good job,
Send me your sample source, i put it in the framework,
regards
This is really interesting Fenistil.
It can make things much easier. I was thinking at a Firemonkey -> DPF NativeIOS converter, where you program using Firemonkey Controls and later, you lauch the conversion. However, this approach is far more better.
Hi Babak!
I'm happy to hear you are interested in it. :) Today I was busy with other things, so I just make a little change, but I will continue doing it. (Try to set the ButtonType to btDetailDisclosure)
In the GUI.zip you'll find 2 folders and a font. The font is used by the iOS, but it isnt't necessary. The "Add to framework" folder contains the files I created or modified. You need to add these to the framework. The "Resources" folder contains the additional files that I use to implement the GUI, but these aren't needed to be included in the framework, they are used just for compiling the "Fenistil.iOS_DesignTime.res" file (I compiled it already).
In the "DPF.iOS.UIButton.pas" you will find all the changes if you search for "Fenistil", because I commented all of them I've made. In the future I think I need to implement function more deeply into the framework because of complex controls (like Toolbar, or TableView), so I'll always comment what I've done.
Firstly I will do the simpler controls like Buttons, Edits, Switch, etc. and later the more complex ones. In the most cases I need to add the resources to the control (GUI record in the private section), load these on Create and Free them on Destroy and override the Paint and Resize methods. So you can modify everything else, I will always try to post any new code as soon as possible to you.
I think now you should wait for the Button to be complete and then add it to the newest version of you Button. I think it can be done in about 2 days. So try it out for now, and I will post the new code as soon as it completes.
Regards,
Fenistil
Last edit: Fenistil 2013-07-13
Hi, Fenistil
Thank you for your good job,
I'm waitting to complete your work,
To standardize source code and file names, please observe file names in the same way,
but you can comment all you functions and procedures you name like:
//----------------------------------------------
// Author: Fenistil
//----------------------------------------------
then, please change :
1)
Fenistil.iOS_DesignTime.Functions.pas
to
DPF.iOS.DesignTime.pas
and put your code with your comments into this file,
2)
Fenistil.iOS_DesignTime.res
to
DPF.iOS.DesignTime.res
3)
Fenistil.iOS_DesignTime.rc
to
DPF.iOS.DesignTime.rc
and comment your name into DPF.iOS.DesignTime.rc file name like above comment.
I aslo share this file (DPF.iOS.DesignTime.rc) into framework
if me or others want to add or change any functions, we can do it any changes on this unit.
Thank you for your good work,
Regards
Hi
The button will complete soon, but I think, I can't make the custom Images (like greenButton@2x.png) to work, because the path is not known within the IDE (/Documents/...), only on the device. But I think it isn't a real problem.
I will change the filenames.
If you include the RC file, then you have to include the PNGs as well.
Regards
Hi!
The followings are ready: Button, Slider, Stepper, Switch :)
I'll post the source tomorrow, because it's 3:00 am now and somehow I have to wake up tomorrow :D
Good night!
Last edit: Babak Yaghoobi 2013-07-14
Hi Babak!
I applied all the modifications to the 1.8.2 framework and here it is. :)
So as I wrote, the Button, Slider, Stepper and Switch are done. Try them, everything should work fine (change the IsOn property, or set the Value of the slider :))
In the button I can't take in account the new Font property because in Windows there is different font names. If we made a "compatible list" between the windows font names and the ios' ones, then it would be possible to show the button's font correctly in the IDE.
Regards,
Fenistil
Hi, Fenistil
Thank you for your good job,
I see button unit and i think must be have a some changes,
I'm currently working on another classes, and I will apply your good work in source to weekends.
thanks again for your nice work
Last edit: Babak Yaghoobi 2013-07-15
What changes are you thinking about in the button unit?
Hi,
1)
One of the changes in fixing size of buttons with button type,
Not be fixed, iOS button can be have system icon (info) and text,
Generally all buttons is flexible and dynamic size, and icons must be left of text (if have a text).
i think you must be change BitmapAsBackground function and pass into bitmap and text then inside function calculate size of text(textWidth) and sum it with bitmap and find center of button and draw first icon then text, ...
firstXForDraw := Max((button.with - (textWidth+iconWidth)) div 2, 0);
2)
Change :
GUI: record RoundedRect, DetailDisclosure, InfoLight, InfoDark, ContactAdd: TBitmap; end;
to one variable: GUIButton
and create it on create Event:
GUIButton.RoundedRect := TBitmap.Create( 0, 0 );
without this command : LoadResourceToBitmap( GUIButton, '???????' );
move this command to SetButtonType procedure and loadResource with case of button type
i hope this helpfull
Last edit: Babak Yaghoobi 2013-07-15
Okay, I try to implement this today.
Maybe I will change all the bitmap handlings. Now, if the user has 5 buttons, the bitmaps are loaded 5 times. I will move all the bitmaps to the global section of "DPF.iOS.DesignTime.pas", load them in the unit's initialize section, and free then in the finalize. This way I have to load every bitmap only once. That way has the smallest memory footprint, and the faster approach (only 1 LoadResource / bitmap).
Last edit: Fenistil 2013-07-15
Babak can you add Fenistil to the subversioning users?
New version is here. Based on v1.8.2.
Changes:
1. Button implementaion corrected for all button types.
2. Button's caption is altered according to the value of TextLineBreak.
3. All bitmaps are moved to the "DPF.iOS.DesignTime.pas" and loaded only once per running Delphi IDE. This way, only two functions need to be changed in the components (Paint, Resize).
Installation, for those who want to try it:
1. Uninstall Native iOS package from IDE if installed.
2. Overwrite the files in your 1.8.2 library with the files in the "Add to Framework" folder in the ZIP.
3. Build "DPFiOSPackagesR.dproj" for Win32, iOS Simulator and iOS Device.
4. Build and Install "DPFiOSPackagesD.dproj" for Win32. Build it for iOS Simulator and iOS Device.
5. Create a mobile app (or load one), put a Button, Slider, Switch or Stepper to the Form.
Have fun :)
Greetings
Last edit: Fenistil 2013-07-18
Hi, Fenistil
Thank you for your goot work, this is very good
I do little changes on the source, and then I'll add the Framework.
Thanks again
Regards
Last edit: Babak Yaghoobi 2013-07-16
It works perfectly and I must say this is an awesome work.
The form designing using these designtime components is - by far - much more intuitive and visual.
I can´t wait to see other components!
Thanks Fenistil
Last edit: Diego 2013-07-16
I'm really very happy to hear that :) Today I'll work on the SegmentedControl and the DateTimePicker.
Babak: If you have the changes please send me a copy, thanks.
Greeetings
PS.: Babak: You've forget to update the History post in the forum for 1.8.2.
Last edit: Fenistil 2013-07-16
Hi, Fenistil
I'm currently working on another classes,
make you changes and development and then send me,
Ohh, thanks, i will update it with next release.
Thanks,
Hi Everyone!
Here is the new version! Still based on 1.8.2.
Changelog:
* 2 new controls: SegmentedControl, DatePicker
For installation check post above.
Have fun :)
Last edit: Fenistil 2013-07-18
Hi, Fenistil
Thank you for this great work,
I will be add in the next release ( tomorrow ),
regards
Hi, Fenistil
I thing you send a wrong [Add to framework\DPF.iOS.DesignTime.pas]
not have a BitmapToPosition procedure.
regards
Last edit: Babak Yaghoobi 2013-07-18
Great work Fenistil. I really appreciate it.
Do you dare with TableView ? :P
Greetings
Thanks :)
Good question... I'd go from simpler controls to the more complex ones, and I think the TableView is one of the most complex ones :D I don't know. Now I make some changes to the DatePicker, then I would like to do the Edit components. This will take some days after that I'll think what to do next. On the other hand I need to wait for the TableView to be completed (added Cell support, etc.), and I need a lot of testing, because it can be very very different, so it will take time. But I'll do it, just wait for it :)
Uhm, sorry, it was late (2 am :D).
I changed the GUI.zip in the last post. Try, it should work now.
Regards
Hi Babak!
I checked the source code of the integrated Designtime components, and you removed a functions that needed:
1. The TDPFSegmentedControlItem.SetTitle is needed, because if you modify the Title of a segment in the Object Inspector, the control doesn't redraw itself until the user go back to the Form designer and click on it or move it. I'll put it back now, please keep it in the source.
Thanks