October 21, 2013 Re: D / GtkD for SQL Server | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Joyus | On 2013-10-21 06:53, John Joyus wrote: > Thanks. Does it need Java runtime on end user's machine? No, it's a complete D port. No libraries are necessary except for the system libraries (GTK+ on Linux). -- /Jacob Carlborg |
October 21, 2013 Re: D / GtkD for SQL Server | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Joyus | On Monday, 21 October 2013 at 05:14:50 UTC, John Joyus wrote: > Btw, I had to comment out the lines that contain TextLabel and the .content in the example code as it fails to compile with following errors: I just added that class yesterday and probably forgot to push to github grab new versions here: https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/minigui.d also update simpledisplay.d https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/simpledisplay.d (the Win32 headers that come with phobos are woefully incomplete, so if you do just about any Windows programming, you'll either want to get the win32 bindings or do your own with extern(Windows). I went the the latter to minimize dependencies, but that is only functions as i need them. The more complete bindings are here: http://www.dsource.org/projects/bindings/browser/trunk/win32 ) Anyway, with the new versions, that should compile and then you'll have an easier time labeling your fields and getting the answers out. |
October 21, 2013 Re: D / GtkD for SQL Server | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | The full example now compiles with those two new files, thanks.
When I run the executable, the edit control shows no usable height. It reduced to 0.5 mm, and width goes beyond the window, leaving a scroll bar.
Trying to set its Height and Width in the example program had no effect.
Btw, I have tested this on Windows XP. (I can try the exe on Windows 7 later today, if that helps).
On 10/21/2013 11:19 AM, Adam D. Ruppe wrote:
> I just added that class yesterday and probably forgot to push to github
>
> grab new versions here:
> https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/minigui.d
>
>
> also update simpledisplay.d
> https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/simpledisplay.d
|
October 21, 2013 Re: D / GtkD for SQL Server | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Joyus | On Monday, 21 October 2013 at 19:01:11 UTC, John Joyus wrote: > When I run the executable, the edit control shows no usable height. It reduced to 0.5 mm, and width goes beyond the window, leaving a scroll bar. oops, it was not supposed to have a scroll bar at all. Fixed, it was a one line change, line 1823, remove the HSCROLL members. New version is on github too. > Btw, I have tested this on Windows XP. (I can try the exe on Windows 7 later today, if that helps). I've had some trouble with WinXP and background colors on checkboxes and radioboxes too.... are you seeing that? I couldn't reproduce on Vista or Win7 so I thought it might just be my setup here, but if it is off for you too it must be something more. |
October 21, 2013 Re: D / GtkD for SQL Server | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 10/21/2013 03:29 PM, Adam D. Ruppe wrote: > oops, it was not supposed to have a scroll bar at all. Fixed, it was a > one line change, line 1823, remove the HSCROLL members. > > New version is on github too. That works! > I've had some trouble with WinXP and background colors on checkboxes and > radioboxes too.... are you seeing that? The checkbox in the example looks fine to me on my WinXP. (I haven't used the radioboxes yet. I can confirm that later). I have a couple other things: 1. When I click the OK button, the message dialog pops-up *after* the main window is closed, though the window.close(); line is after the call to the MessageBox.. 2. The controls appear to align to client by default. How do I position them where I want them and with the height and width of my choice. Thanks. |
October 21, 2013 Re: D / GtkD for SQL Server | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Joyus | On Monday, 21 October 2013 at 22:23:16 UTC, John Joyus wrote: > 1. When I click the OK button, the message dialog pops-up *after* the main window is closed, though the window.close(); line is after the call to the MessageBox.. that's because the MessageBox class here is implemented as another window with an event loop, so it doesn't stop execution. If you want a message box that stops execution, you should just use the regular Windows call http://msdn.microsoft.com/en-us/library/windows/desktop/ms645505%28v=vs.85%29.aspx it is available in D if you do this: import core.sys.windows.windows; import std.string : toStringz; MessageBoxA(null, toStringz("You clicked ok."), toStringz("title here"), MB_OK); (or you can use MessageBoxW and toUTF16z instead of toStringz if you need unicode support) > 2. The controls appear to align to client by default. How do I position them where I want them and with the height and width of my choice. I just added a new thing called StaticLayout that lets you do this: auto window = new MyMainWindow(); auto layout = new StaticLayout(layout); auto btn = new Button("test", layout); btn.x = 100; btn.y = 200; btn.width = 100; btn.height = 50; If the only child of the window is a StaticLayout, you can set the x,y, width, height on each part of it and it will honor that. The method registerMovement() btw is the key here. When it is called, it calls MoveWindow to inform Windows of the updated position. It is called automatically by the function recomputeChildLayout(), which by default, also changes the size and position automatically. The new StaticLayout class overrides recomputeChildLayout to call registerMovement without trying to change things itself. (This is new btw becuase I kinda hate doing manual positioning and wanted the automatic grid to work first. But then I didn't get back to finish the other options when another project took over, so there's a lot of minigui.d that isn't quite done, including this.) |
October 22, 2013 Re: D / GtkD for SQL Server | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 10/21/2013 07:27 PM, Adam D. Ruppe wrote: > On Monday, 21 October 2013 at 22:23:16 UTC, John Joyus wrote: >> 1. When I click the OK button, the message dialog pops-up *after* the >> main window is closed, though the window.close(); line is after the >> call to the MessageBox.. > > that's because the MessageBox class here is implemented as another > window with an event loop, so it doesn't stop execution. > > If you want a message box that stops execution, you should just use the > regular Windows call > > http://msdn.microsoft.com/en-us/library/windows/desktop/ms645505%28v=vs.85%29.aspx > > > it is available in D if you do this: > > import core.sys.windows.windows; > import std.string : toStringz; > MessageBoxA(null, toStringz("You clicked ok."), toStringz("title here"), > MB_OK); > > (or you can use MessageBoxW and toUTF16z instead of toStringz if you > need unicode support) > >> 2. The controls appear to align to client by default. How do I >> position them where I want them and with the height and width of my >> choice. > > I just added a new thing called StaticLayout that lets you do this: > > auto window = new MyMainWindow(); > auto layout = new StaticLayout(layout); > > auto btn = new Button("test", layout); > > btn.x = 100; > btn.y = 200; > btn.width = 100; > btn.height = 50; > > > If the only child of the window is a StaticLayout, you can set the x,y, > width, height on each part of it and it will honor that. > > The method registerMovement() btw is the key here. When it is called, it > calls MoveWindow to inform Windows of the updated position. It is called > automatically by the function recomputeChildLayout(), which by default, > also changes the size and position automatically. > > The new StaticLayout class overrides recomputeChildLayout to call > registerMovement without trying to change things itself. > > > (This is new btw becuase I kinda hate doing manual positioning and > wanted the automatic grid to work first. But then I didn't get back to > finish the other options when another project took over, so there's a > lot of minigui.d that isn't quite done, including this.) That works! Thanks. I have tried the previous example like below, with manual positioning. Having this light weight minigui is very encouraging to me to learn D :) The 99% of my programs demand a basic GUI. And I personally love to create stand-alone tools that do not have a ton of dependencies, esecially anything that doesn't come with Winodws by default. I think Delphi has spoiled me! :) import arsd.minigui; import core.sys.windows.windows; import std.string : toStringz; void main() { auto window = new MainWindow(); // use StaticLayout to position the controls manually (or use HorizontalLayout to put them side-by-side) auto layout = new StaticLayout(window); auto lblName = new TextLabel("Your Name:", layout); lblName.x = 20; lblName.y = 40; auto edtName = new LineEdit(layout); edtName.x = 110; edtName.y = 40; edtName.height = 20; edtName.width = 200; auto cbUseful = new Checkbox("Useful?", layout); cbUseful.x = 110; cbUseful.y = 100; cbUseful.width = 750; cbUseful.height = 25; auto btnOk = new Button("OK", layout); btnOk.x = 20; btnOk.y = 425; btnOk.width = 75; btnOk.height = 25; auto btnClose = new Button("Close", layout); btnClose.x = 110; btnClose.y = 425; btnClose.width = 75; btnClose.height = 25; // the triggered event is like click, but also works with keyboard activation // other possible events are click, mouseover, mouseenter, and a few others from javascript, search the minigui.d source for EventType for a list so far btnOk.addEventListener(EventType.triggered, { if(cbUseful.isChecked) MessageBoxA(null, toStringz(" Thanks for liking MiniGUI"), toStringz("D App with MiniGUI"), MB_OK); else MessageBoxA(null, toStringz(" Thanks for trying MiniGUI"), toStringz("D App with MiniGUI"), MB_OK); window.close(); }); btnClose.addEventListener(EventType.triggered, { if (MessageBoxA(null, toStringz("Are you sure you want to close this application?"), toStringz("D App with MiniGUI"), MB_YESNO | MB_ICONQUESTION) == IDYES) window.close(); }); // run the event loop. it terminates when the last window is closed. window.loop(); } |
October 25, 2013 Re: D / GtkD for SQL Server | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Joyus | On Tuesday, 22 October 2013 at 06:33:04 UTC, John Joyus wrote: > That works! Thanks. cool. If you need anything more in this, let me know (feel free to email me directly too destructionator@gmail.com ) and i'll see what I can do. > The 99% of my programs demand a basic GUI. And I personally love to create stand-alone tools that do not have a ton of dependencies, esecially anything that doesn't come with Winodws by default. Yeah, it isn't as commonly used for me (most my programs are actually text or web) but I like lightweight too since it is just so much easier to use on other computers. minigui.d has an (even more incomplete than the Windows parts) implementation on Linux too, but I'm writing that for me and me alone, so it will probably never be great... but can work in a pinch if you ever need that. |
October 25, 2013 Re: D / GtkD for SQL Server | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 10/24/2013 10:28 PM, Adam D. Ruppe wrote: > On Tuesday, 22 October 2013 at 06:33:04 UTC, John Joyus wrote: >> That works! Thanks. > > cool. If you need anything more in this, let me know (feel free to email > me directly too destructionator@gmail.com ) and i'll see what I can do. That is great! Thank you so much for the direct access and willing to develop this further. Right now I am being pulled into different directions at work but I will get back to this in a couple of weeks. Though I am a noob at D right now, I am dreaming of eventually building some killer apps in D. :) > >> The 99% of my programs demand a basic GUI. And I personally love to >> create stand-alone tools that do not have a ton of dependencies, >> esecially anything that doesn't come with Winodws by default. > > Yeah, it isn't as commonly used for me (most my programs are actually > text or web) but I like lightweight too since it is just so much easier > to use on other computers. > Another reason I try to avoid external dependencies is, most of my end users (colleagues and clients) are not very computer savvy. For example, I cannot ask them to install Gtk+ on their computers. > minigui.d has an (even more incomplete than the Windows parts) > implementation on Linux too, but I'm writing that for me and me alone, > so it will probably never be great... but can work in a pinch if you > ever need that. I understand the minigui is incomplete at this time, but the basic things are working great already. It is pretty fast and stable. And I am good at testing and asking for features that would be useful for all :) I'll be in touch through emails. thanks. |
October 25, 2013 Re: D / GtkD for SQL Server | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Joyus | On Sunday, 20 October 2013 at 08:13:35 UTC, John Joyus wrote: > I am learning D and itching to create some small tools (basically Windows executables) for our internal use, but any tool I think of creating also needs some support for SQL Server! So my question is: > > 1). Does D has any support for MSSQL? See here: http://forum.dlang.org/thread/qcxoafwuachwnnwqklom@forum.dlang.org |
Copyright © 1999-2021 by the D Language Foundation