digitalmars.D - Need sounding board for GUI library
- Boyd (79/79) Dec 15 2013 Hey everyone,
- MrSmith (29/29) Dec 15 2013 Hi Boyd.
- Boyd (64/94) Dec 15 2013 I Have not yet uploaded it, though I would like to. Where would
- Zz (9/107) Dec 15 2013 Hi Boyd,
- Boyd (4/12) Dec 15 2013 Yeah, this is definitely interesting. GDI is pretty limiting,
- John Colvin (2/9) Dec 15 2013 Github is the usual destination these days. Or Bitbucket.
- Idan Arye (4/11) Dec 15 2013 https://github.com/
- MrSmith (15/20) Dec 15 2013 Look for github. They also have pretty convenient client for
- Boyd (26/46) Dec 15 2013 Thanks, I've already created an account. I'm currently building
- Walter Bright (2/6) Dec 15 2013 github. No question about it.
- Marco Leise (5/105) Dec 15 2013 A Delphi VCL user!
- Boyd (2/4) Dec 15 2013 A long time ago, yes:) Some of it stuck.
- John J (3/8) Dec 15 2013 If you can make it anything close to Delphi VCL or Lazarus components,
- Rikki Cattermole (4/83) Dec 15 2013 You may be interested in my GUI toolkit for some ideas[1].
- Marco Leise (10/10) Dec 16 2013 Something that is often forgotten when writing your own GUI
- Boyd (5/15) Dec 16 2013 Accessibility and state remembrance are definitely things I need
Hey everyone, I'm looking for help with a GUI library I'm working on. Right now I have a pretty good basis, but it's mostly catering to my own whims. I'm looking for someone to help me figure out which of my design choices are a good idea, and which need some revising. This is currently the biggest obstacle that prevents me from making it public. The other obstacle I could use some help with, is deployment. I don't have a lot of experience with open source projects, but I want to get this one out there and I want to do it right. If you're willing to help out, let me know. Cheers, Boyd. PS. Here is a description of the project. The goal of this library, like any GUI library, is to make GUI's a lot easier to build. Here are some of the characteristics of the library: - It's non-native. If I'm going to support native components it will be far into the future, because in my experience, native components tend to be much too limiting. - It's platform independent. That said, I currently only support win32, but it's written in a platform independent way and should easily be portable to other platforms. Once the first version is out of the way, this will be a top priority. - Its main goal is to make custom widgets easy to create. Even without supplying any widgets this library should be useful. That said I do plan to eventually add many widgets to it, but the first version will only have a few. - Multi-touch support. This is built into the very core of the library. Every widget you create can use it. - Grid layout techniques. The library contains ways to layout your components, so that you won't need to calculate positions or sizes in the majority of cases. Here is some sample code, to show you what it looks like. public class TestApplication: TUiApplication { /// Initialize the application public override void Initialize() { auto title = new TTextGraphic( "An uninteresting application", TFont("Verdana", 30), TColor.Rgb(1,1,1), TColor.Rgb(0,0,0), TAnchor.Center ); auto image = new TImageGraphic( LocalFileStore.GetFile(`C:\Images\GrandPiano.png`) ); auto exitButton = new TButtonWidget("Quit"); exitButton.PressEvent.Bind(&this.Quit); auto main = new TVerticalLayout( [ title, image, exitButton ], [ new TGridLayoutRow(TSizeUnit.Auto), new TGridLayoutRow(TSizeUnit.Remainder(1)), new TGridLayoutRow(TSizeUnit.Auto) ] ); Ui.ShowWidgetFullScreen( Ui.GetScreens()[0], main ); } /// Clean up the application public override void Finalize(){ } /// Whether or not the application will quit. /// Use this, for example, to ask the user whether to save changes public override bool AllowQuit() { return true; } } int main(string[] argv) { Run(new TestApplication()); }
Dec 15 2013
Hi Boyd. Have you uploaded your code somewhere so anyone can take a look at it? Let me ask you some questions. 1. How have you done event propagation? Sinking and boobling or something else? Can you cancel event propagation? 2. How do you create platform dependent windows. Using WinAPI, SFML, GLFW(+), SDL(+), GLUT? 3. How are you rendering widgets? Using OpenGL(+), DirectX, SDL, SFML, GDI? If it is OpenGL than what version of it? 4. How your widgets are rendered? Do you have separate GuiRenderer which knows how to render basic GUI elements(+) or all widgets are directly calling OpenGL code? 5. Do you have any styling of your widgets, external config, CSS etc? If any how it is done? Can you set any image or color, gradient to any widget? 6. How is your resource management implemented? Do you have any dedicated texture, font manager? 7. Do you have animation support (plans to do it)? 8. How is your widget events and properties implemented? Signals, variants, reactive programming etc? 8. Do you have model and view separation? Controllers, presenters? 9. How is your layouts implemented? Do you have layout interface? What methods it has? When they are called? 10. Can you access property by its name like widget.getProperty("width"); 11. Do you know that in D is common to use camelCase for method names? 12. What other gui's are you looking at while making your own?
Dec 15 2013
On Sunday, 15 December 2013 at 12:59:27 UTC, MrSmith wrote:Hi Boyd. Have you uploaded your code somewhere so anyone can take a look at it?I Have not yet uploaded it, though I would like to. Where would be a good place to put it?Let me ask you some questions. 1. How have you done event propagation? Sinking and boobling or something else? Can you cancel event propagation?The event propagation method I use is event capturing. First the event goes to the outer most widget which determines whether to send it to child widgets.2. How do you create platform dependent windows. Using WinAPI, SFML, GLFW(+), SDL(+), GLUT?Platform dependent widgets are not supported at this time. I may add native widgets in the future, but right now it seems more trouble than it's worth.3. How are you rendering widgets? Using OpenGL(+), DirectX, SDL, SFML, GDI? If it is OpenGL than what version of it?I currently use GDI. It should not be that hard to change this, though.4. How your widgets are rendered? Do you have separate GuiRenderer which knows how to render basic GUI elements(+) or all widgets are directly calling OpenGL code?I have created a Canvas class that does all the drawing. This ensures platform independences. You can also use graphic objects to do the drawing instead; the TImageGraphic object draws an image, TTextGraphic draws text, etc..5. Do you have any styling of your widgets, external config, CSS etc? If any how it is done? Can you set any image or color, gradient to any widget?I have plans for stylable widgets, but I don't have a concrete design for this yet. I have some ideas though, and I intend for it to be immensely flexible. Basically a stylable widget would be a widget without a style at all. The widget would only define a list of placeholder blocks that the theme would need to fill. For example: The TButtonWidget could define the placeholders Normal, Hover, Down, DownHover. The theme would then determine the exact content of these placeholders. Gradients, images, text, borders, layout, you name it.6. How is your resource management implemented? Do you have any dedicated texture, font manager?No I don't, although the theme system will do some resource management. Would you consider this as an important feature outside of themes?7. Do you have animation support (plans to do it)?No concrete plans, but eventually I do want to support it.8. How is your widget events and properties implemented? Signals, variants, reactive programming etc?At first simply changing properties will have to do. I do intend to support something similar to signals.8. Do you have model and view separation? Controllers, presenters?I'm not sure what you mean. A GUI library by its very nature is pure view.9. How is your layouts implemented? Do you have layout interface? What methods it has? When they are called?There are to ways to do layout. You can inherit from a layout component, in which case you would need to implement a few functions. For example the gridlayout requires the implementation of the following functions: /// iterates through the rows of the grid void ForeachRow(TCanvas canvas, void delegate(TGridLayoutRow) exec); /// iterates through the columns of the grid void ForeachColumn(TCanvas canvas, void delegate(TGridLayoutRow) exec); /// returns the content of the specified grid cell TGraphic GetCell(int x, int y); The other method is to create a TGridWidget using the constructor: this(TGridLayoutRow[] columns, TGridLayoutRow[] rows, TGraphic[][] cells)10. Can you access property by its name like widget.getProperty("width");No. In what situation would you consider using this? Also Widgets don't have any positional information in them, or style information. This is one of main issues I have with the existing GUI libraries.11. Do you know that in D is common to use camelCase for method names?As I said earlier I built this library to cater to my every whim, so I probably need to change my coding style slightly.12. What other gui's are you looking at while making your own?There are many gui libraries that have influenced my design, but I don't plan to immitate any of them. Most influence come from the old Borland delphi design, which is still used in many of the current ones among which is QT, WxWidgets, other ideas are from ExtJs and html/css. It is a fairly unique design though, which is why I worry about whether it will be usable by other programmers. Thanks for the questions, I look forward to hear what you think of my answers. Feel free to criticise. Cheers, Boyd
Dec 15 2013
Hi Boyd, Here something that might be interesting for you the gui is wrappers). http://www.creativedocs.net/devs/gui http://www.creativedocs.net/devs/agg http://www.creativedocs.net/screenshots/ Zz On Sunday, 15 December 2013 at 14:19:10 UTC, Boyd wrote:On Sunday, 15 December 2013 at 12:59:27 UTC, MrSmith wrote:Hi Boyd. Have you uploaded your code somewhere so anyone can take a look at it?I Have not yet uploaded it, though I would like to. Where would be a good place to put it?Let me ask you some questions. 1. How have you done event propagation? Sinking and boobling or something else? Can you cancel event propagation?The event propagation method I use is event capturing. First the event goes to the outer most widget which determines whether to send it to child widgets.2. How do you create platform dependent windows. Using WinAPI, SFML, GLFW(+), SDL(+), GLUT?Platform dependent widgets are not supported at this time. I may add native widgets in the future, but right now it seems more trouble than it's worth.3. How are you rendering widgets? Using OpenGL(+), DirectX, SDL, SFML, GDI? If it is OpenGL than what version of it?I currently use GDI. It should not be that hard to change this, though.4. How your widgets are rendered? Do you have separate GuiRenderer which knows how to render basic GUI elements(+) or all widgets are directly calling OpenGL code?I have created a Canvas class that does all the drawing. This ensures platform independences. You can also use graphic objects to do the drawing instead; the TImageGraphic object draws an image, TTextGraphic draws text, etc..5. Do you have any styling of your widgets, external config, CSS etc? If any how it is done? Can you set any image or color, gradient to any widget?I have plans for stylable widgets, but I don't have a concrete design for this yet. I have some ideas though, and I intend for it to be immensely flexible. Basically a stylable widget would be a widget without a style at all. The widget would only define a list of placeholder blocks that the theme would need to fill. For example: The TButtonWidget could define the placeholders Normal, Hover, Down, DownHover. The theme would then determine the exact content of these placeholders. Gradients, images, text, borders, layout, you name it.6. How is your resource management implemented? Do you have any dedicated texture, font manager?No I don't, although the theme system will do some resource management. Would you consider this as an important feature outside of themes?7. Do you have animation support (plans to do it)?No concrete plans, but eventually I do want to support it.8. How is your widget events and properties implemented? Signals, variants, reactive programming etc?At first simply changing properties will have to do. I do intend to support something similar to signals.8. Do you have model and view separation? Controllers, presenters?I'm not sure what you mean. A GUI library by its very nature is pure view.9. How is your layouts implemented? Do you have layout interface? What methods it has? When they are called?There are to ways to do layout. You can inherit from a layout component, in which case you would need to implement a few functions. For example the gridlayout requires the implementation of the following functions: /// iterates through the rows of the grid void ForeachRow(TCanvas canvas, void delegate(TGridLayoutRow) exec); /// iterates through the columns of the grid void ForeachColumn(TCanvas canvas, void delegate(TGridLayoutRow) exec); /// returns the content of the specified grid cell TGraphic GetCell(int x, int y); The other method is to create a TGridWidget using the constructor: this(TGridLayoutRow[] columns, TGridLayoutRow[] rows, TGraphic[][] cells)10. Can you access property by its name like widget.getProperty("width");No. In what situation would you consider using this? Also Widgets don't have any positional information in them, or style information. This is one of main issues I have with the existing GUI libraries.11. Do you know that in D is common to use camelCase for method names?As I said earlier I built this library to cater to my every whim, so I probably need to change my coding style slightly.12. What other gui's are you looking at while making your own?There are many gui libraries that have influenced my design, but I don't plan to immitate any of them. Most influence come from the old Borland delphi design, which is still used in many of the current ones among which is QT, WxWidgets, other ideas are from ExtJs and html/css. It is a fairly unique design though, which is why I worry about whether it will be usable by other programmers. Thanks for the questions, I look forward to hear what you think of my answers. Feel free to criticise. Cheers, Boyd
Dec 15 2013
Yeah, this is definitely interesting. GDI is pretty limiting, though for the moment it's enough. I think I've actually used this a long long time ago. Is there a D binding for AntiGrain? On Sunday, 15 December 2013 at 14:40:09 UTC, Zz wrote:Hi Boyd, Here something that might be interesting for you the gui is wrappers). http://www.creativedocs.net/devs/gui http://www.creativedocs.net/devs/agg http://www.creativedocs.net/screenshots/ Zz
Dec 15 2013
On Sunday, 15 December 2013 at 14:19:10 UTC, Boyd wrote:On Sunday, 15 December 2013 at 12:59:27 UTC, MrSmith wrote:Github is the usual destination these days. Or Bitbucket.Hi Boyd. Have you uploaded your code somewhere so anyone can take a look at it?I Have not yet uploaded it, though I would like to. Where would be a good place to put it?
Dec 15 2013
On Sunday, 15 December 2013 at 14:19:10 UTC, Boyd wrote:On Sunday, 15 December 2013 at 12:59:27 UTC, MrSmith wrote:https://github.com/ GitHub has many advantages, but the most relevant would be it's awesome code-review system.Hi Boyd. Have you uploaded your code somewhere so anyone can take a look at it?I Have not yet uploaded it, though I would like to. Where would be a good place to put it?
Dec 15 2013
I Have not yet uploaded it, though I would like to. Where would be a good place to put it?Look for github. They also have pretty convenient client for Windows. Do widgets internally hold their position and size or they are recalculated every time gui is rendered? When widget will relayout its children. How are you drawing text? What type of string do use for text rendering (string, wstring, dstring etc)? Do you plannig to do declarative markup like QML or XUL? Do you have any working text editing components? Have you looked at QTQuick/DQuick? https://github.com/D-Quick/DQuickAlso Widgets don't have any positional information in them, or style information. This is one of main issues I have with the existing GUI libraries.Does it mean that you have one theme for the whole application. Do you have any size restrictions in your widget styles or it is pure appearence information? If later it is fine.
Dec 15 2013
On Sunday, 15 December 2013 at 15:35:19 UTC, MrSmith wrote:Thanks, I've already created an account. I'm currently building the directory structure.I Have not yet uploaded it, though I would like to. Where would be a good place to put it?Look for github. They also have pretty convenient client for Windows.Do widgets internally hold their position and size or they are recalculated every time gui is rendered?The container of the widget is responsible for positioning and sizing the children. This container generally remembers where the widgets are, but not necessarily. Also, the widgets cache their own last known size, which is needed for some events.When widget will relayout its children.Layout will be redetermined if the container widget decides this.How are you drawing text?I currently use ExtTextOutW if that's what you mean.What type of string do use for text rendering (string, wstring, dstring etc)?regular string.Do you plannig to do declarative markup like QML or XUL?Yes, I'm working on a format that defines themes and I'm trying to figure out how to best implement multilingual information.Do you have any working text editing components?Yes, a simple one. I'm also working on one that allows markup, but it'll take some timeHave you looked at QTQuick/DQuick? https://github.com/D-Quick/DQuickIt's a bit more complicated than that. The standard widgets I'm working on will not allow you to specify any style information directly, you can't even set the text of a button. You will be able to specify the functional aspects of the widget and the name. This name is later used by the theme system to determine the style of the widget. This done to get a better separation of functionality and presentation. If you do want information from the application into the style, you will have to send the information as a parameter to the style which determines what to do with it.Also Widgets don't have any positional information in them, or style information. This is one of main issues I have with the existing GUI libraries.Does it mean that you have one theme for the whole application. Do you have any size restrictions in your widget styles or it is pure appearence information? If later it is fine.
Dec 15 2013
On Sunday, 15 December 2013 at 16:47:00 UTC, MrSmith wrote:Ok, cool. Now waiting to check it on github.Ok, I finally got it ready and working. https://github.com/GaboonViper/CinchUi Keep in mind that it's very much work in progress. The base is fairly solid, but the widgets still need plenty of work. Not to mention I need to add some documentation and refactor the coding style. Cheers, Boyd
Dec 16 2013
On Sunday, 15 December 2013 at 16:47:00 UTC, MrSmith wrote:Ok, cool. Now waiting to check it on github.This may take a while. On Sunday, 15 December 2013 at 16:51:10 UTC, MrSmith wrote:Btw, have you worked with MVVM pattern?From what I can tell it's barely any different from MVC, but no I haven't.
Dec 15 2013
On Sunday, 15 December 2013 at 17:08:21 UTC, Boyd wrote:Yes, you are right. Will you integrate something like this into your gui or it would be possible to add on top of it? Mostly i am looking for data-bindings.On Sunday, 15 December 2013 at 16:51:10 UTC, MrSmith wrote: Btw, have you worked with MVVM pattern?From what I can tell it's barely any different from MVC, but no I haven't.
Dec 15 2013
On Sunday, 15 December 2013 at 17:11:05 UTC, MrSmith wrote:On Sunday, 15 December 2013 at 17:08:21 UTC, Boyd wrote:With data-bindings, I assume you mean for fields, such as textfields, checkboxes, lists, etc.. I don't have this yet, but it is on the todo list. There is nothing that stands in your way of creating something on top of it (except for me actually getting the library ready for use:P).Yes, you are right. Will you integrate something like this into your gui or it would be possible to add on top of it? Mostly i am looking for data-bindings.On Sunday, 15 December 2013 at 16:51:10 UTC, MrSmith wrote: Btw, have you worked with MVVM pattern?From what I can tell it's barely any different from MVC, but no I haven't.
Dec 15 2013
On 12/15/2013 6:19 AM, Boyd wrote:On Sunday, 15 December 2013 at 12:59:27 UTC, MrSmith wrote:github. No question about it.Have you uploaded your code somewhere so anyone can take a look at it?I Have not yet uploaded it, though I would like to. Where would be a good place to put it?
Dec 15 2013
Am Sun, 15 Dec 2013 12:41:54 +0100 schrieb "Boyd" <gaboonviper gmx.net>:Hey everyone, I'm looking for help with a GUI library I'm working on. Right now I have a pretty good basis, but it's mostly catering to my own whims. I'm looking for someone to help me figure out which of my design choices are a good idea, and which need some revising. This is currently the biggest obstacle that prevents me from making it public. The other obstacle I could use some help with, is deployment. I don't have a lot of experience with open source projects, but I want to get this one out there and I want to do it right. If you're willing to help out, let me know. Cheers, Boyd. PS. Here is a description of the project. The goal of this library, like any GUI library, is to make GUI's a lot easier to build. Here are some of the characteristics of the library: - It's non-native. If I'm going to support native components it will be far into the future, because in my experience, native components tend to be much too limiting. - It's platform independent. That said, I currently only support win32, but it's written in a platform independent way and should easily be portable to other platforms. Once the first version is out of the way, this will be a top priority. - Its main goal is to make custom widgets easy to create. Even without supplying any widgets this library should be useful. That said I do plan to eventually add many widgets to it, but the first version will only have a few. - Multi-touch support. This is built into the very core of the library. Every widget you create can use it. - Grid layout techniques. The library contains ways to layout your components, so that you won't need to calculate positions or sizes in the majority of cases. Here is some sample code, to show you what it looks like. public class TestApplication: TUiApplication { /// Initialize the application public override void Initialize() { auto title = new TTextGraphic( "An uninteresting application", TFont("Verdana", 30), TColor.Rgb(1,1,1), TColor.Rgb(0,0,0), TAnchor.Center ); auto image = new TImageGraphic( LocalFileStore.GetFile(`C:\Images\GrandPiano.png`) ); auto exitButton = new TButtonWidget("Quit"); exitButton.PressEvent.Bind(&this.Quit); auto main = new TVerticalLayout( [ title, image, exitButton ], [ new TGridLayoutRow(TSizeUnit.Auto), new TGridLayoutRow(TSizeUnit.Remainder(1)), new TGridLayoutRow(TSizeUnit.Auto) ] ); Ui.ShowWidgetFullScreen( Ui.GetScreens()[0], main ); } /// Clean up the application public override void Finalize(){ } /// Whether or not the application will quit. /// Use this, for example, to ask the user whether to save changes public override bool AllowQuit() { return true; } } int main(string[] argv) { Run(new TestApplication()); }A Delphi VCL user! -- Marco
Dec 15 2013
On Sunday, 15 December 2013 at 14:38:12 UTC, Marco Leise wrote:Am Sun, 15 Dec 2013 12:41:54 +0100 A Delphi VCL user!A long time ago, yes:) Some of it stuck.
Dec 15 2013
On 12/15/2013 10:12 AM, Boyd wrote:On Sunday, 15 December 2013 at 14:38:12 UTC, Marco Leise wrote:If you can make it anything close to Delphi VCL or Lazarus components, it would be awesome!! :)Am Sun, 15 Dec 2013 12:41:54 +0100 A Delphi VCL user!A long time ago, yes:) Some of it stuck.
Dec 15 2013
On Sunday, 15 December 2013 at 11:41:55 UTC, Boyd wrote:Hey everyone, I'm looking for help with a GUI library I'm working on. Right now I have a pretty good basis, but it's mostly catering to my own whims. I'm looking for someone to help me figure out which of my design choices are a good idea, and which need some revising. This is currently the biggest obstacle that prevents me from making it public. The other obstacle I could use some help with, is deployment. I don't have a lot of experience with open source projects, but I want to get this one out there and I want to do it right. If you're willing to help out, let me know. Cheers, Boyd. PS. Here is a description of the project. The goal of this library, like any GUI library, is to make GUI's a lot easier to build. Here are some of the characteristics of the library: - It's non-native. If I'm going to support native components it will be far into the future, because in my experience, native components tend to be much too limiting. - It's platform independent. That said, I currently only support win32, but it's written in a platform independent way and should easily be portable to other platforms. Once the first version is out of the way, this will be a top priority. - Its main goal is to make custom widgets easy to create. Even without supplying any widgets this library should be useful. That said I do plan to eventually add many widgets to it, but the first version will only have a few. - Multi-touch support. This is built into the very core of the library. Every widget you create can use it. - Grid layout techniques. The library contains ways to layout your components, so that you won't need to calculate positions or sizes in the majority of cases. Here is some sample code, to show you what it looks like. public class TestApplication: TUiApplication { /// Initialize the application public override void Initialize() { auto title = new TTextGraphic( "An uninteresting application", TFont("Verdana", 30), TColor.Rgb(1,1,1), TColor.Rgb(0,0,0), TAnchor.Center ); auto image = new TImageGraphic( LocalFileStore.GetFile(`C:\Images\GrandPiano.png`) ); auto exitButton = new TButtonWidget("Quit"); exitButton.PressEvent.Bind(&this.Quit); auto main = new TVerticalLayout( [ title, image, exitButton ], [ new TGridLayoutRow(TSizeUnit.Auto), new TGridLayoutRow(TSizeUnit.Remainder(1)), new TGridLayoutRow(TSizeUnit.Auto) ] ); Ui.ShowWidgetFullScreen( Ui.GetScreens()[0], main ); } /// Clean up the application public override void Finalize(){ } /// Whether or not the application will quit. /// Use this, for example, to ask the user whether to save changes public override bool AllowQuit() { return true; } } int main(string[] argv) { Run(new TestApplication()); }You may be interested in my GUI toolkit for some ideas[1]. There is also DQuick being worked on. [1] https://github.com/rikkimax/DOOGLE
Dec 15 2013
Something that is often forgotten when writing your own GUI toolkit is the tight integration of the native toolkits with the typical available hardware (e.g. touchscreen, mouse with 1 button), the desktop environment (remembering open windows after reboot, allowing only one instance and opening multiple documents in the same instance), accessibility support and last not least an IME for languages with large symbolic alphabets that cannot be represented on a keyboard normally, like Chinese, Japanese, Korean. By no means do I want to demotivate you :)
Dec 16 2013
On Monday, 16 December 2013 at 12:54:22 UTC, Marco Leise wrote:Something that is often forgotten when writing your own GUI toolkit is the tight integration of the native toolkits with the typical available hardware (e.g. touchscreen, mouse with 1 button), the desktop environment (remembering open windows after reboot, allowing only one instance and opening multiple documents in the same instance), accessibility support and last not least an IME for languages with large symbolic alphabets that cannot be represented on a keyboard normally, like Chinese, Japanese, Korean. By no means do I want to demotivate you :)Accessibility and state remembrance are definitely things I need to think about. Thanks. I already have support for multi-touch. And support for foreign languages should be there, although I haven't tested it.
Dec 16 2013