Re: Is HibernateD dead?
On Monday, 7 May 2018 at 17:27:17 UTC, Jesse Phillips wrote: You should get a hold of Vadim Lopatin and see if he would give you commit rights to the main repo. There was a great article I can't find by someone who would add contributors if they made good pull requests. It helped to keep his work living on and didn't need to keep involved. So I push for people to follow this model (remove contributors if it isn't working out. Guys, if you want to get permissions for pushing to buggins/ddbc and buggins/hibernated, please send me you github id to coolreader@gmail.com
Re: Is HibernateD dead?
On Thursday, 3 May 2018 at 20:49:35 UTC, Matthias Klumpp wrote: On Thursday, 3 May 2018 at 18:52:34 UTC, singingbush wrote: On Thursday, 3 May 2018 at 10:27:47 UTC, Pasqui23 wrote: Last commit on https://github.com/buggins/hibernated was almost a year ago So what is the status of HibernateD?Should I use it if I need an ORM? Or would I risk unpatched security risks? Both hibernated and ddbc have had open pull requests for months. It's really frustrating. Oh hey :-) I applied your patches for ddbc and hibernated a to my copy while back, because they weren't merged and fix real issues. There are also other patches floating around, for example people will really want https://github.com/KrzaQ/hibernated/commit/efa38c50effdd77e973b174feea89016b8d1fa1f applied when using hibernated. If there is enough interest, we can maybe provide at least some basic level of maintenance for these projects together, maybe under the dlang-community umbrella or similar. Per adoption guidelines[1], I think the projects are popular enough, but Hibernated is of course not the only D ORM (although a pretty complete one), and the continued maintenance is also not sure, even when PRs finally get reviewed and accepted faster (but that really depends on the library users). In any case, we need to get in contact with buggins. I asked him ages ago about Hibernated on Gitter, but that was probably the worst way to contact him (as he is active on Github, but probably never read that message). [1]: https://github.com/dlang-community/discussions Guys, If someone is ready to maintain these projects, I can grant privileges for github repositories ddbc, hibernated. Best regards, Buggins
Re: Mirroring a drawable buf in DLangUI?
On Tuesday, 21 November 2017 at 13:45:31 UTC, Dukc wrote: I am using the DrawRescaled method of DrawBuf[1] of DLangUI To draw a PNG image to a CanvasWidget[2] subclass. It has a minor issue of the box bounds showing in area that shoud be transparent but otherwise works well. My question is, does anybody know a way to draw that image backwards without making another PNG file to do so? I tried to pass a dstrect with negative width but that results in nothing being drawn. 1: http://buggins.github.io/dlangui/ddox/dlangui/graphics/drawbuf/DrawBuf.html 2: http://buggins.github.io/dlangui/ddox/dlangui/widgets/controls/CanvasWidget.html There is no such feature currently, but it can be added easy.
Re: Access Violation when passing the result of a C function directly to a D function?
On Friday, 15 September 2017 at 04:01:13 UTC, Timothy Foster wrote: I'm compiling on Windows 7 x64, DMD32 D Compiler v2.075.1 and I'm using Derelict Fmod to handle audio in my application. Every Fmod function returns an int telling me if the function ran okay, or if there was an error. I've written the following helper function that will print something for me if it encounters an error: static void ErrorFMOD(int result, string msg = ""){ if(result != FMOD_OK) writeln("[ FMOD ] ", msg, FMOD_ErrorString(result)); } This function has been causing Access Violation Errors when I call it. It doesn't happen every time and it doesn't always happen in the same place. The errors occur _even when I comment out everything inside the function_. I've been calling it like so: ErrorFMOD(FMOD_System_Create(), "Error Creating System: "); Making the calls without my helper function doesn't cause an Access Violation. Calling it like this is the only thing that seems to fix it: auto result = FMOD_System_Create(); ErrorFMOD(result, "Error Creating System: "); Is this a known issue, or am I required to save the result of a C function to variable before passing it into another function or? Probably you have to use const char * msg when interfacing with C. string is a struct - size_t length and const char * value
Re: Problems with the DLangUI TreeWidget
On Monday, 11 September 2017 at 17:57:14 UTC, pezi_pink wrote: On Monday, 11 September 2017 at 09:00:36 UTC, Vadim Lopatin Fixed in v0.9.121 See example1 / TreeWidget for sample of adding / removing of items. Fantasic! Thank you very much :) Feel free to submit issues on https://github.com/buggins/dlangui/issues if something is unclear or does not work as expected.
Re: betterC and struct destructors
On Monday, 11 September 2017 at 10:18:41 UTC, Oleg B wrote: Hello. I try using destructor in betterC code and it's work if outer function doesn't return value (void). Code in `scope (exit)` works as same (if func is void all is ok). In documentation I found https://dlang.org/spec/betterc.html#consequences 12 paragraph: Struct deconstructors. Why struct destructor need Druntime? Compiler must simply past call of destructor before exit from scope or return statement. Where is Druntime here (dynamic allocations, pointers to scopes and other)? I think struct destructor must work in betterC code. Otherwise it will be one step to be likeC, not betterC. +1 I don't see the reason. If struct destructors were working correctly in betterC mode, it would be possible to use RAII. Missing RAII is a main reason of WTF messages when people see list of betterC limitations.
Re: Problems with the DLangUI TreeWidget
On Friday, 8 September 2017 at 15:39:21 UTC, pezi_pink wrote: On Friday, 8 September 2017 at 15:08:27 UTC, Vadim Lopatin wrote: On Friday, 8 September 2017 at 12:10:23 UTC, pezi_pink wrote: [...] It's known issue: https://github.com/buggins/dlangui/issues/278 Not sure if there is any workaround. Ah, thanks for the reply. I did check the issues on git, obviously not well enough! That's a shame, it renders (no pun intended) DLangUI basically useless for my project :( maybe I will have to get the debugger out ... Fixed in v0.9.121 See example1 / TreeWidget for sample of adding / removing of items.
Re: Problems with the DLangUI TreeWidget
On Friday, 8 September 2017 at 15:39:21 UTC, pezi_pink wrote: On Friday, 8 September 2017 at 15:08:27 UTC, Vadim Lopatin wrote: On Friday, 8 September 2017 at 12:10:23 UTC, pezi_pink wrote: [...] It's known issue: https://github.com/buggins/dlangui/issues/278 Not sure if there is any workaround. Ah, thanks for the reply. I did check the issues on git, obviously not well enough! That's a shame, it renders (no pun intended) DLangUI basically useless for my project :( maybe I will have to get the debugger out ... Will try to fix it in a few days.
Re: DLang IDE [RU]
On Thursday, 7 September 2017 at 12:24:40 UTC, TM wrote: Это понятно, что у Java своя организационная специфика, в принципе если в диалоге создание файла минимизировать количество кликов, то есть сразу вводишь имя файла с клавиатуры и кнопка создания будет реагировать на Entrer (а не Ctrl+N), будет вполне юзабельно. Сделал. Ctrl+N (type module name here) Enter Должно быть удобно. Новый релиз v0.7.71 - исправлено много замечаний. Есть бинарник для Win32 https://github.com/buggins/dlangide/releases
Re: Problems with the DLangUI TreeWidget
On Friday, 8 September 2017 at 12:10:23 UTC, pezi_pink wrote: I am having some seemingly basic problems using the TreeWidget from DLangUI on Windows. I posted on the project's gitter channel some time ago but did not get any response. All I am trying to do is add children to the tree's nodes at runtime. The simple code below attempts to add a new node when a button is pressed. As far as I can tell, the node does indeed get added, since the new node responds to keyboard events, but it does not render. I have tried everything to get it to render, using all the available invalidate/redraw methods, even as far as removing and re-adding the control again to its layout, but nothing seems to work. Any advice would be greatly received! extern (C) int UIAppMain(string[] args) { auto window = Platform.instance.createWindow("DlangUI example - HelloWorld", null); auto vlayout = new VerticalLayout(); TreeWidget tree = new TreeWidget("Root"); TreeItem tree2 = tree.items.newChild("machinesroot", "Machines"d, null); auto machine0 = tree2.newChild("machine0", "Machine 0"d, null); machine0.newChild("machine0stack", "Stack", null); auto btn = (new Button("btn1", "Button 1"d)); btn.click = delegate(Widget src) { // this gets added but does not render tree2.newChild("machine1", "Machine 1"d, null); return true; }; vlayout.addChild(btn); vlayout.addChild(tree); window.mainWidget = vlayout; window.show(); return Platform.instance.enterMessageLoop(); } Thanks It's known issue: https://github.com/buggins/dlangui/issues/278 Not sure if there is any workaround.
Re: DLang IDE [RU]
On Wednesday, 6 September 2017 at 13:05:29 UTC, Vadim Lopatin wrote: On Tuesday, 5 September 2017 at 15:40:06 UTC, TM wrote: 1. Добавить возможность выбора размера шрифта для области редактирования. Я крайне редко меняю подобные настройки в IDE, но в данном случае дефолтный шрифт оказался откровенно мелковат (возможно под Linux ситуация несколько иная), пришлось за не имением выбора размера шрифта искать более крупный шрифт. Submitted issue / feature request: Add editors default font size setting https://github.com/buggins/dlangide/issues/249 Implemented in v0.7.68 Win32 binaries are released.
Re: DLang IDE [RU]
On Wednesday, 6 September 2017 at 13:20:08 UTC, Vadim Lopatin wrote: On Tuesday, 5 September 2017 at 15:40:06 UTC, TM wrote: 2. В области Workspace Explorer на одном уровне иерархии модули и пакеты сортируются по алфавиту, но "вперемешку" с друг другом, в отличие от того же Notepad++, где сначала по алфавиту сортируются пакеты, а потом модули. Понимая, что такой режим также может оказаться неудобным для части пользователей, предлагаю сделать настройку с режимом сортировки. И если, файлы package.d имеют некий "особый" статус в языке, возможно имеет смысл выделять их как-то (например другой иконкой или font.bold=true) Надо исправлять, просто не замечал. Issue submitted: https://github.com/buggins/dlangide/issues/250 Fixed in v0.7.67
Re: DLang IDE [RU]
On Thursday, 7 September 2017 at 07:04:11 UTC, Suliman wrote: А можно сделать как-то так, чтобы автокомплит работал сразу? Как в студии. То есть бы не приходилось ctrl+пробел нажимать. Issue submitted: https://github.com/buggins/dlangide/issues/253
Re: DLang IDE [RU]
On Wednesday, 6 September 2017 at 17:36:53 UTC, TM wrote: On Wednesday, 6 September 2017 at 14:33:18 UTC, Vadim Lopatin wrote: On Wednesday, 6 September 2017 at 14:06:56 UTC, TM wrote: On Wednesday, 6 September 2017 at 13:07:04 UTC, Vadim Lopatin wrote: File / new для добавления пакетов/модулей не пойдет? Удалять также можно. Перемещать - нельзя. File / new создает модуль. А как создавать пакет? New Source File -> Location -> Bew Folder ? Удалять возможности не нашел Удобного создания package нет, можно использовать workaround: Да тут ключевое слово "удобный", пока удобней создавать через сторонний файловый менеджер. В Netbeans в его аналоге "Workspace Explorer" правый клик и в контекстном меню на выбор Новый -> Папка, класс, пакет, интерфейс и т.д. Хорошо, если бы чтото подобное было реализовано в Dlang IDE. Новый класс/енум/интерфейс имеет смысл для java, где, как правило, один класс = один файл. Для D самая полезная функция - создать модуль. Если при открытии диалога создать файл будет выбран шаблон модуль и фокус на редакторе имени, а по Enter - срабатывать кнопка создания файла - все будет удобно. Создание папок само по себе достаточно бесполезно. Папки без файлов не показываются в Workspace explorer, а новая папка с файлом создается в диалоге выбора папки для файла. В Workspace Explorer есть еще один если не баг, то не очень удобный момент: при закрытии вкладки с кодом или при создании нового модуля, то есть по сути при "рефреше" дерева слетает текущее позиционирование курсора и состояние закрытых открытых узлов дерева. То есть перед "рефрешем" надо сохранить состояние курсора и состояние узлов дерева(раскрыт/закрыт), а после обновления восстановить (по-возможности) как было, с учетом того, что какие-то файлы/папки могут быть удалены. Я подобное реализовывал даже на допотопном Treeview ActiveX от майкрософта, тут же имея свой "карманный" GUI как говорится все карты в руки это допилить. Issue submitted: https://github.com/buggins/dlangide/issues/252
Re: DLang IDE [RU]
On Wednesday, 6 September 2017 at 14:33:18 UTC, Vadim Lopatin wrote: On Wednesday, 6 September 2017 at 14:06:56 UTC, TM wrote: On Wednesday, 6 September 2017 at 13:07:04 UTC, Vadim Lopatin wrote: File / new для добавления пакетов/модулей не пойдет? Удалять также можно. Перемещать - нельзя. File / new создает модуль. А как создавать пакет? New Source File -> Location -> Bew Folder ? Удалять возможности не нашел Удобного создания package нет, можно использовать workaround: Уже не нужен workaround: https://github.com/buggins/dlangide/issues/251 File / Create / New File или в Workspace Explorer на src или поддиректории контекстное меню / new file Template: Package
Re: DLang IDE [RU]
On Wednesday, 6 September 2017 at 14:06:56 UTC, TM wrote: On Wednesday, 6 September 2017 at 13:07:04 UTC, Vadim Lopatin wrote: File / new для добавления пакетов/модулей не пойдет? Удалять также можно. Перемещать - нельзя. File / new создает модуль. А как создавать пакет? New Source File -> Location -> Bew Folder ? Удалять возможности не нашел Удалять - в Workspace Explorer - контекстное меню на файле, Delete Удаляет только файлы. Файлы удаляются из файловой системы, нет возможности просто выкинуть из проекта, а сам файл - оставить. После удаления всех файлов из папки из проекта пропадет папка (в файловой системе останется).
Re: DLang IDE [RU]
On Wednesday, 6 September 2017 at 14:06:56 UTC, TM wrote: On Wednesday, 6 September 2017 at 13:07:04 UTC, Vadim Lopatin wrote: File / new для добавления пакетов/модулей не пойдет? Удалять также можно. Перемещать - нельзя. File / new создает модуль. А как создавать пакет? New Source File -> Location -> Bew Folder ? Удалять возможности не нашел Удобного создания package нет, можно использовать workaround: File / Create / New File или в Workspace Explorer на src или поддиректории контекстное меню / new file Template: Empty module В location выбрать директорию (создать новые директорию / поддиректорию). Например, внутри projectname/src создаем директорию api, затем core В module name - package Создается файл с содержимым module api.core.package; меняем на package api.core;
Re: DLang IDE [RU]
On Tuesday, 5 September 2017 at 15:40:06 UTC, TM wrote: 1. Невозможно собрать как IDE, так и любой пример из DlangUI, если в профиле пользователя windows используются символы кириллицы. Компиляция через DMD/LDC падает на DlangUI с: module exception is in file 'C:\Users\русский_юзернейм\AppData\Roaming\dub\packages\derelict-util-2.0.6\derelict-util\source\derelict\util\exception.d' which cannot be read Вероятно, проблема с utf8 именами файлов в DMD frontend.
Re: DLang IDE [RU]
On Tuesday, 5 September 2017 at 15:40:06 UTC, TM wrote: 2. Под англоязычной учетной записью windows последняя удачная сборка IDE была 0.7.45 или 0.7.46, дальше DMD начал падать с "Out of memory", LDC также начал выдавать ошибку. Проблема также похоже во "внутренностях" DlangUi, так как примеры DLangUi не собираются ровно с теми же симптомами. Пробовал как советовалось в рекомендациях чистить папку с "кашем" dub, но безрезультатно. Наверное, после недавних изменений с compile time reflection для поиска property в виджетах стало есть больше памяти при компиляции. Какой размер RAM? В Releases я в последнее время выкладываю win32 binary. https://github.com/buggins/dlangide/releases
Re: DLang IDE [RU]
On Tuesday, 5 September 2017 at 15:40:06 UTC, TM wrote: 3. Очень непривычное поведение редактора при копипасте строки. Обычная комбинация: Home, Shift+End (выделяется вся строка), Ctrl+C, End (для снятия выделения), Enter (для перехода на другую строку), Ctrl+V оканчивается тем, что End после Ctrl+C не снимает выделение строки (как это делали все известные мне до сих пор редакторы, даже консольный редактор в Far Manager), а последующий Enter не переводит каретку, а удаляет выделенную строку. Возможно, опять же, это какое-то неизвестное мне каноническое поведение, но крайне неудобно. Это баг. Действительно, неудобно. DlangUI issue is submitted: Editors: selection is not removed after End key press https://github.com/buggins/dlangui/issues/421
Re: DLang IDE [RU]
On Tuesday, 5 September 2017 at 15:40:06 UTC, TM wrote: 2. В области Workspace Explorer на одном уровне иерархии модули и пакеты сортируются по алфавиту, но "вперемешку" с друг другом, в отличие от того же Notepad++, где сначала по алфавиту сортируются пакеты, а потом модули. Понимая, что такой режим также может оказаться неудобным для части пользователей, предлагаю сделать настройку с режимом сортировки. И если, файлы package.d имеют некий "особый" статус в языке, возможно имеет смысл выделять их как-то (например другой иконкой или font.bold=true) Надо исправлять, просто не замечал. Issue submitted: https://github.com/buggins/dlangide/issues/250
Re: DLang IDE [RU]
On Tuesday, 5 September 2017 at 15:40:06 UTC, TM wrote: 1. Добавить возможность выбора размера шрифта для области редактирования. Я крайне редко меняю подобные настройки в IDE, но в данном случае дефолтный шрифт оказался откровенно мелковат (возможно под Linux ситуация несколько иная), пришлось за не имением выбора размера шрифта искать более крупный шрифт. Submitted issue / feature request: Add editors default font size setting https://github.com/buggins/dlangide/issues/249
Re: DLang IDE [RU]
On Tuesday, 5 September 2017 at 16:18:25 UTC, TM wrote: Из более серьезных улучшений, я бы предложил возможность в Workspace Explorer добавлять пакеты, переименовывать пакеты / модули, перемещать пакеты / модули и удалять пакеты / модули. Но это, очевидно уже будет требовать некоторых усилий на реализацию. А так, за неимением, IDE работает впаре с файловым менеджером (в моем случае это проводник Winodws или Far). File / new для добавления пакетов/модулей не пойдет? Удалять также можно. Перемещать - нельзя.
Re: DCD as a library - stops working after some thread is created.
On Friday, 11 August 2017 at 08:17:32 UTC, Vadim Lopatin wrote: I'm using DCD as a library in DlangIDE. All DCD calls are made from separate thread. DCD works ok until some thread is created (e.g. to invoke DUB for building). /// call this function after DCD ModuleCache is instantiated to reproduce issue void testDCDFailAfterThreadCreation() { import core.thread; Thread thread = new Thread(delegate() { Thread.sleep(dur!"msecs"(2000)); }); thread.start(); thread.join(); }
DCD as a library - stops working after some thread is created.
I'm using DCD as a library in DlangIDE. All DCD calls are made from separate thread. DCD works ok until some thread is created (e.g. to invoke DUB for building). After this operation DCD stops working correctly and can locate symbols only from current source file. Root cause: If some another thread is created after DCD thread instantiated ModuleCache, DCD is not able to process goToDefinition for symbol and other functions if they are related to other modules than current source file. Probably, it's related to ModuleCache and/or allocators. Steps to reproduce: After creation of ModuleCache, start some thread and wait until it's finished. Does someone know some workaround? Filed DCD issue 407. DCD stops working if some thread is created after instantiation of ModuleCache https://github.com/dlang-community/DCD/issues/407
Difference between dstring and string format specifiers support. Bug?
Looks like bug. dchar[] and wchar[] format strings support less specifiers than char[] import std.format; string test1 = "%02d".format(1); // works assert(test1 == "01"); dstring test2 = "%d"d.format(1); // works assert(test2 == "1"d); wstring test3 = "%02d"w.format(1); // fails assert(test3 == "01"w); dstring test4 = "%02d"d.format(1); // fails assert(test4 == "01"d);
Re: Difference between dstring and string format specifiers support. Bug?
On Wednesday, 9 November 2016 at 08:21:53 UTC, Vadim Lopatin wrote: Looks like bug. dchar[] and wchar[] format strings support less specifiers than char[] import std.format; string test1 = "%02d".format(1); // works assert(test1 == "01"); dstring test2 = "%d"d.format(1); // works assert(test2 == "1"d); wstring test3 = "%02d"w.format(1); // fails assert(test3 == "01"w); dstring test4 = "%02d"d.format(1); // fails assert(test4 == "01"d); dmd 2.072.0
Re: How to get sqlite3.lib x64?
On Monday, 24 October 2016 at 05:43:00 UTC, Andre Pany wrote: Hi, I try to get sqlite3.lib for 64 Bit windows os. I tried implib with the def file and the 64 Bit dll: implib sqlite3_implib.lib sqlite3.def /system -> App crash (Windows 10) With the dll file defined: implib sqlite3_implib.lib sqlite3.dll /system -> Error message: Error(10): Error: cannot read DLL input file I have the MS Build tools installed, but the example from the SQLite site only shows, how to build a X86 dll file from the C source code but not how to build the X86_64 lib file for windows: cl sqlite3.c -link -dll -out:sqlite3.dll I tried different combinations but without success. Could you give me some hints? Kind regards André In https://github.com/buggins/ddbc there are 32bit and 64bit windows libs and dlls for sqlite3: https://github.com/buggins/ddbc/tree/master/libs
Re: SQLite
On Wednesday, 19 October 2016 at 16:01:37 UTC, Alfred Newman wrote: Hello, I am trying to handle a SQLite3 table with D. During my researchs, I discovered the lib https://dlang.org/phobos/etc_c_sqlite3.html. However, for any reason, there is no code snippets or sample codes available there. So, I am stucked. I have the following sample structure table: sql = "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) " \ "VALUES (1, 'Paul', 32, 'California', 2.00 ); " \ "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) " \ "VALUES (2, 'Allen', 25, 'Texas', 15000.00 ); " \ "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)" \ "VALUES (3, 'Teddy', 23, 'Norway', 2.00 );" \ "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)" \ "VALUES (4, 'Mark', 25, 'Rich-Mond ', 65000.00 );"; Can you pls provide a code snippet or some hints to the following job: - Create a table with the layout above - Iterate through the records given a basic SELECT WHERE Query Thanks in advance, AN Snippet how to do it using DDBC library https://github.com/buggins/ddbc import ddbc; string url = "sqlite:testdb.sqlite"; // creating Connection auto conn = createConnection(url); scope(exit) conn.close(); // creating Statement auto stmt = conn.createStatement(); scope(exit) stmt.close(); // execute simple queries to create and fill table stmt.executeUpdate("CREATE TABLE COMPANY (ID int, NAME varchar, AGE int,ADDRESS varchar, SALARY double)"); string[] statements = [ "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (1, 'Paul', 32, 'California', 2.00 )", "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (2, 'Allen', 25, 'Texas', 15000.00 )", "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (3, 'Teddy', 23, 'Norway', 2.00 )" ]; foreach(sql; statements) stmt.executeUpdate(sql);
Re: DLang IDE for macOS
On Thursday, 6 October 2016 at 09:31:43 UTC, Alexander Milushev wrote: Hi all, Is there any good IDE for DLang for macOS? I have used Xamarin Studio with D Language Addin but currently it does not supported by developer. Also I have tried Idea with D Language plugin but autocomplete did not work. If you are looking for Dlang IDE, try DlangIDE :) https://github.com/buggins/dlangide No precompiled binaries available. But you can built it yourself. For building, you need some D compiler and DUB. Clone dlangide project, then use `dub run` To work, it needs libsdl2 installed. As project format and build tool it uses DUB. For debugging, you will need gdb. (DlangIDE supports gdb mi2 interface).
Re: Basic sounds' playing
On Saturday, 8 October 2016 at 01:00:20 UTC, Cleverson Casarin Uliana wrote: Hello all, starting to learn d, apreciating it so far. I'd like to play/stop wave sound files assynchronously on Windows. Can I get a module for that by installing a particular compiler, or is there any package for it instead? Thank you, Cleverson Here you can find list of DUB audio related packages. http://code.dlang.org/?sort=updated=library.audio Not sure what would be suitable for you. What kind of app are you developing?
Re: What is the best way to store bitarray (blob) for pasting in database?
On Wednesday, 6 April 2016 at 12:56:39 UTC, Suliman wrote: I have next task. There is PostgreSQL DB. With field like: id, mydata. mydata - is binary blob. It can be 10MB or even more. I need load all data from PostgreSQL to SQLLite. I decided ti create struct that and fill it with data. And then do INSERT operation in sqllite. But I do not know is it's good way, and if it's ok what data type should I use for blob (binary data). struct MyData { string id; string mydata; // what datatype I should use here?? } MyData [] mydata; MyData md; while (rs.next()) { md.id = to!string(rs.getString(1)); md.mydata = to!string(rs.getString(2)); //?? mydata ~= md; } stmtLite.executeUpdate(`insert into MySyncData(id,mydata) values(md.id,md.data)`); //ddbc driver is it's normal way to insert data? Use ubyte[] or byte[] for blob, and setUbytes/getUbytes (setBytes/getBytes) to set/get value There was issue in `bytea` type support in PostgreSQL driver. Now it's fixed.
Re: PostgreSQL. Unknown parameter of configuration : "autocommit"
On Tuesday, 5 April 2016 at 07:53:20 UTC, Suliman wrote: Is there anybody who have success connect to PostgreSQL with ddbc? I am getting next error: https://github.com/buggins/ddbc/issues/22 Fixed.
Re: Error: no property 'select' for type 'ddbc.core.Statement'
On Sunday, 31 January 2016 at 09:15:04 UTC, Suliman wrote: I hope that here I will get answer faster then on https://github.com/buggins/ddbc/issues/18 I am using ddbc diver for access to mysql. I need to return result of request to struct. My code is next: import std.stdio; import ddbc.all; import std.stdio; import std.conv; void main() { string[string] params; MySQLDriver driver = new MySQLDriver(); string url = MySQLDriver.generateUrl("localhost", 3306, "test"); params = MySQLDriver.setUserAndPassword("root", "pass"); DataSource ds = new ConnectionPoolDataSourceImpl(driver, url, params); // creating Connection auto conn = ds.getConnection(); scope(exit) conn.close(); // creating Statement auto stmt = conn.createStatement(); scope(exit) stmt.close(); string sql = "select * from test.imgs"; auto images = stmt.executeQuery(sql); struct myData { int id; string date; } foreach(ref e; stmt.select!myData) { } /* this code is work while(images.next()) { string mydata = images.getString(4); writeln(mydata); readln; } */ } I am getting error: Error: no property 'select' for type 'ddbc.core.Statement' What I am doing wrong? You forgot to add "import ddbc.pods;" Sorry for late answer :) Closing issue.
Re: D, GTK, Qt, wx,…
On Sunday, 29 May 2016 at 11:03:36 UTC, Russel Winder wrote: Is there even a wxD? Or perhaps there is an alternative that fits the bill of being production ready now, and either gives the same UI across all platforms or provides a platform UI with no change of source code, just a recompilation. There is DlangUI library. Gives same UI across all platforms, no source code change required, just recompilation. Widget set is not as full as in Qt or wx, but it's easy to extend, because DlangUI is not a binding, and written completely in D.
Re: Benchmark Dlang vs Node vs Ruby
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote: Hi guys, In my journey of learning about D I tried to benchmark D with Vibe.d vs node with express and Ruby with Sinatra. And the results are pretty surprising. I have to admit that I though D was more faster than that. How is this even possible ? I am doing something wrong ? Here are the numbers with the project : https://github.com/llaine/benchmarks/blob/master/README.md Probably node and Ruby cache PGSQL connection - keeping it open.
Re: Game Development Using D
On Saturday, 21 May 2016 at 15:53:18 UTC, David wrote: Hi, I want to try to create a game using D. I'm a complete newbie though (other than having C/C++ experience). Where would I start? Does D have an openGL binding? I am assuming I'll need to leverage a good amount C APIs? Any list of these that would be useful it a game setting? Obviously this all depends on *how* much work I want to do. Ideally, I'd like a collection of tools that will get me roughly the equivalent of what XNA provides. In DlangUI there is Tetris game example Repository: https://github.com/buggins/dlangui Tetris: https://github.com/buggins/dlangui/tree/master/examples/tetris Clone repository, cd dlangui/examples/tetris, dub run As well, there are OpenGL example https://github.com/buggins/dlangui/tree/master/examples/opengl and DMiner example (minecraft-like rendering engine) https://github.com/buggins/dlangui/tree/master/examples/dminer
Re: import("dir/file") does not work
On Wednesday, 18 May 2016 at 12:20:14 UTC, Andrew Chamberlain wrote: Thank you! It looks like it's not yet included into recent DMD beta available for download. in nightly perhaps ? https://dlang.org/download.html#dmd-nightly the latest beta is always for a "point" release so it only includes regressions fixed from the previous "discrete" (.0) release, not the bug fixed since the "discrete" release to the "point" release. Thank you! Working on nightly build.
Re: import("dir/file") does not work
On Wednesday, 18 May 2016 at 06:47:08 UTC, Atila Neves wrote: On Wednesday, 18 May 2016 at 05:11:51 UTC, Vadim Lopatin wrote: Hello, Is it intended that import of file as array does not work if path is specified for import file name? import("dir/file.ext"); // does not work import("file.ext"); // works if dir is added to -J list I believe it would be convenient if I could just specify one -J path (e.g. -Jviews) and import any file from nested directories just by providing relative path from one of -J dirs. (checked on latest DMD under Windows; replacing / with \\ does not help) Best regards, Vadim That was a bug that was recently fixed. Atila Thank you! It looks like it's not yet included into recent DMD beta available for download.
import("dir/file") does not work
Hello, Is it intended that import of file as array does not work if path is specified for import file name? import("dir/file.ext"); // does not work import("file.ext"); // works if dir is added to -J list I believe it would be convenient if I could just specify one -J path (e.g. -Jviews) and import any file from nested directories just by providing relative path from one of -J dirs. (checked on latest DMD under Windows; replacing / with \\ does not help) Best regards, Vadim
Re: DlangIDE Themes
On Thursday, 12 May 2016 at 09:57:42 UTC, Chris wrote: On Thursday, 12 May 2016 at 09:51:18 UTC, thedeemon wrote: On Thursday, 12 May 2016 at 09:17:24 UTC, Chris wrote: They shouldn't be hardwired. Best would be to load them dynamically with their respective names encoded in the xml file. In this way people could add their own themes as they see fit. I wouldn't mind creating themes and adding them to DlangIDE as a humble contribution. Don't forget that contents of all those files in resources.list is also "hardwired" into the executable, so there's not much difference between mentioning something in such list file and in the source code. Of course, dynamic loading would be a nice thing to do, in addition to what there is now. Sure, but changing `resources.list` is trivial and can be added to the docs like so "Add the path to your theme file to `resources.list` and restart DlangIDE." It has to be hardwired somewhere, but it shouldn't be the themes. Other editors/IDE's allow you to load your own themes. This is important, because apart from aesthetics, some people might find certain themes easier on the eye than others, e.g. color blind people or people with some sort of visual impairment. Hello, External themes support is planned. It is not a hard task. Btw, try to copy your resource files (res directory) to the same place dlangui executable (e.g. dlangide) is located. Resources from this directory must be accessible from application. The only problem should be list of themes in UI settings. AFAIR, resources from directory should have higher priority than embedded ones. So for testing, you can rename theme to standard name. Best regards, Vadim
Re: Show window maximized in DlangUI
On Thursday, 5 May 2016 at 07:53:43 UTC, default0 wrote: Hi I'm writing a D Desktop application using DlangUI. I want the window it creates to start maximized (but not Fullscreen) and could not find any APIs in the documentation that seem to do this. Does anyone know how to do this? No such functionality yet. Could you please submit feature request on github?
Re: DlangUI FileDialog not working
On Tuesday, 3 May 2016 at 06:14:25 UTC, stunaep wrote: FileDialog is showing a blank white window for me. Only tested on windows 7 so far, but if I run dmledit, the filedialog on there works fine. It's weird because I am using almost exactly the same code. Try fetch recent dlangui version (dub upgrade --force-remove). I fixed this issue last week. (There was a problem with sharing of OpenGL context between windows). Difference in dmledit is probably due to different dlangui configuration selected - it uses `minimal` configuration - w/o OpenGL acceleration.
Re: DlangUI MouseEvent mouse delta
On Wednesday, 27 April 2016 at 00:15:46 UTC, stunaep wrote: I am currently handling it like this: current = e.pos(); xdelta = current.x - previous.x; ydelta = current.y - previous.y; previous = current; I'm just wondering if there is a built in solution that I missed. There is only information about coordinates where mouse button down event occured. event.lbutton.downX, event.lbutton.downY - stores coordinates of button down event.
Re: DlangUI translations
On Sunday, 24 April 2016 at 23:32:38 UTC, stunaep wrote: On Sunday, 24 April 2016 at 04:49:36 UTC, thedeemon wrote: On Saturday, 23 April 2016 at 15:44:22 UTC, stunaep wrote: I am wondering how to use other languages and how to NOT use other languages. Did you see example1 from examples folder in dlangui? It has two languages and allows switching at runtime via menu. But I don't know how to change the language for ui components such as buttons and text. And the most important thing is removing "UNTRANSLATED: " from items in my list. Are you really see it on example1? It looks like you selected Russian language in "View"/"Interface Language" menu. Select English (in russian translation, it's first item of third main menu item -- "Вид"/"Язык интерфейса"). UNTRANSLATED: prefix is being added to all string resources not found in translation files. For widgets, usually both plain unicode dstring values and string resource ids can be used. E.g. `label.text = "exit"c;` assigns string resource id (views/res/i18n/your_language_code.ini should contain line "exit=SOME_TRANSLATION_HERE", otherwise "UNTRANSLATED: exit" will be shown. Strings specified by resource ids will be automatically translated when language is changed. `label.text = "exit"d; assigns plain unicode string value. Such strings remain unchanged when application language is changed. In DML, when you assign string property as identifier (w/o quotes), it's considered as resource id. When "string in quotes" is assigned, it's plain string. TextWidget { text: RESOURCE_ID } // translation must exist in res/i18n/*.ini files TextWidget { text: "plain text" } // just plain text value
Re: Using D in Android App
On Saturday, 16 April 2016 at 04:04:24 UTC, Justice wrote: Is it difficult to create a D business like app and connect it to android through java for the interface? I'd rather create all the complex stuff in D and either use it natively through java(I need a UI). If it is workable, can the same be said for IOS(just recompile the D source to the IOS architecture then use it in an IOS app for the ui)? I've added basic Android support to DlangUI library recently. http://forum.dlang.org/thread/cdekkumjynhqoxvmg...@forum.dlang.org DlangUI is cross platform GUI library for D. Your source code will be compiled on Windows, Linux, Mac and Android. https://github.com/buggins/dlangui I hope Android backend will become usable soon (still need to add support of timers, text input (with onscreen keyboard), animation, user messages). iOS support will probably be added in future.
Re: Dlang UI - making widget extend to the bounds of the window
On Monday, 18 April 2016 at 07:06:43 UTC, Vadim Lopatin wrote: In TableLayout there is a bug #113 which prevents extending of table layout content to parent size. For other widgets FILL_PARENT should work ok. Issue #113 is fixed today in v0.8.8
Re: Dlang UI - making widget extend to the bounds of the window
On Saturday, 16 April 2016 at 11:46:09 UTC, stunaep wrote: On Saturday, 16 April 2016 at 08:20:33 UTC, stunaep wrote: On Friday, 15 April 2016 at 10:33:35 UTC, Vadim Lopatin wrote: [...] I am doing that. I think it has to do with my high dpi because I'm using a 4k monitor. If I use Modal window flag: [...] http://i.imgur.com/FJgPq8U.png If I use resizable: [...] http://i.imgur.com/PsPwoSN.jpg Actually, that is with the opengl area set to a specific size. Here is using fill: Window window = Platform.instance.createWindow("DlangUI OpenGL Example", null, WindowFlag.Modal, 1250, 1250); http://i.imgur.com/exAyjI0.png Window window = Platform.instance.createWindow("DlangUI OpenGL Example", null, WindowFlag.Resizable, 1250, 1250); http://i.imgur.com/R7oxBa0.jpg http://pastebin.com/qqbfQLvN In TableLayout there is a bug #113 which prevents extending of table layout content to parent size. For other widgets FILL_PARENT should work ok. See dlangui/examples/d3d and dlangui/examples/opengl for samples of OpenGL drawing on widget which is being resized to whole window.
Re: Dlang UI - making widget extend to the bounds of the window
On Friday, 15 April 2016 at 00:58:58 UTC, stunaep wrote: I'm trying to make a gui program with dlangui, but no matter what I do, I cannot get widgets to fill the whole window. The window is resizable so I cannot just set the widths to static numbers. No layoutWidth and layoutHeight set: http://i.imgur.com/UySt30K.png layoutWidth/Height set to fill (left widget width 300): http://i.imgur.com/76tMIFz.png I need these widgets to extend the width of the window because it is resizable http://i.imgur.com/PiL7Y7f.png You can see this also on DlangUI ML editor: fill: http://i.imgur.com/t9DsASt.png wrap: http://i.imgur.com/FoTS69g.png arbitrary number: http://i.imgur.com/voiYTWZ.png For parent VerticalLayout, set layoutWidth: fill too VerticalLayout { id: main; layoutWidth: fill; VerticalLayout { layoutWidth: fill; TextWidget { text: "test"; layoutWidth: fill } } }
Re: Linking a shared library in dub
On Wednesday, 30 March 2016 at 12:19:34 UTC, maik klein wrote: I want to finally convert my project to windows. That means that I want to build it on windows and linux. The problem is that I have one external c library 'glfw'. I thought that I would just link with it explicitly but actually I am not completely sure how. Try using Derelict based binding http://code.dlang.org/packages/derelict-glfw3
Re: How would you implement this in D? (signals & slots)
On Monday, 1 February 2016 at 21:40:45 UTC, Enjoys Math wrote: module signals_and_slots; How do you implement this template called like: void onColorChange(in Color) { // do something with color } auto slots = Slots!(void delegate(in Color), Color); slots.connect(); auto color = Color(0.0, 1.0, 1.0, 1.0); slots.call(color); Signals in DlangUI: https://github.com/buggins/dlangui/blob/master/src/dlangui/core/signals.d
Re: Using libraries for (Postgre)SQL for bilingual (C++ and D) project
On Monday, 11 January 2016 at 07:29:02 UTC, Eliatto wrote: Hello! I have a project, which consists of 2 parts: web part (based on vibe.d) and core part (C++/Qt 5.5.x). Core will be used in a shared object (c-style exported functions). Both parts must interact with PostgreSQL. Core dynamic library will be contributor to my database (INSERTS/UPDATES), while vibe.d part will use SELECTs for views. Which C++ and D libraries for SQL queries should be used in order to minimize boilerplate code? I don't mind against ORM, using plain old objects (PODs) with special attributes. BTW, I've read about https://github.com/chrishalebarnes/quill.d. DDBC contains PostgreSQL driver. https://code.dlang.org/packages/ddbc API is similar to ODBC/JDBC.
Re: Graphics/font/platform backends with common interfaces?
On Wednesday, 23 December 2015 at 19:22:01 UTC, Taylor Hillegeist wrote: So I have seen alot of projects that need the same sort of stuff. graphics libraries gui libraries game libraries ploting libaries they would all benefit from a backend solution with a common interface for color fonts drawing pen_style aliasing etc. but each one i look at seems to have a built up solution with various degrees of integration with things like freetype gdi cairo sdl glew opengl. Shouldn't there be like a common (interface/abstract class) that these back-ends can fulfill? maybe I am unaware of how these things are done. And perhaps there are performance reasons that many of these are baked in. perhaps it should be like: standard color implementation. font interface that converts glyphs into drawing strokes. and a standard set of drawing instructions with transforms. //probably a grotesque simplification interface font_do{ glyphstrokes getstrokes(string characterstoget); } interface draw_do{ drawpixel(double x,double y); drawline(double x,double y); drawglyph(glypstrokes g); getpostdrawnsize(glypstroks g) ... other things } I can consider splitting of DlangUI library into platform and widgets. Platform will provide window creation, initialization of OpenGL context when necessary, keyboard and mouse events, user events. As well, it has font support - FreeType and on Windows it can use native Windows fonts. Currently supported platforms: Windows: Win32 API or SDL Linux, OSX: SDL or X11 I'm planning to make Cocoa (native OSX) and Wayland (for Linux) support later.
Re: How to check if result of request to DB is empty?
On Saturday, 12 December 2015 at 12:06:21 UTC, Suliman wrote: On Saturday, 12 December 2015 at 11:53:51 UTC, Suliman wrote: On Saturday, 12 December 2015 at 11:31:18 UTC, Suliman wrote: Oh sorry! I used wrong host! All ok! Yes, there was issue with host name, but it's do not solve problem. Second DB have same fields and I still getting false instead moving into while loop It's look like it do `next` step before return something. So if in DB 1 value it will work like: do step if no value after it --> return false if yes --> return true but I need any way to check if first value in DB is exists. Any suggestion? If you expect to have single or zero rows in result, use if (rs.next()) { dbuser = rs.getString(1); dbpassword = rs.getString(2); writeln(dbuser); } else { writeln("user not found"); }
Re: Any D IDE on Mac OSX with debugging support?
On Monday, 16 November 2015 at 08:15:36 UTC, Jacob Carlborg wrote: On 2015-11-16 08:48, Rikki Cattermole wrote: On recent versions of OSX, Apple has by default made it so that all applications must be signed by default. You can disable this behavior through system settings and security. I suspect this is what is stopping it. Alternatively use LLDB shipped with Xcode. But that won't of course have the D support that GDB has. Although I don't know if that works for OS X. Mono-D adds -i=mi parameter to debugger command line so it looks like it supports only GDB.
Re: Any D IDE on Mac OSX with debugging support?
On Monday, 16 November 2015 at 07:48:31 UTC, Rikki Cattermole wrote: On 16/11/15 7:45 PM, Vadim Lopatin wrote: Hello, Is there any IDE which allows debugging D apps on OSX? I'm trying Mono-D, but getting error "Debugger operation failed A syntax error in expression, near 'sizeof(void*)'" GDB is installed using homebrew. Probably, something is wrong with my gdb. When I'm trying to start debugging using console GDB interface - it fails with message about unsigned application. Is there any instruction how to get GDB working on OSX? Code completion and symbol lookups neither do not work on Mono-D / OSX. Does anyone managed to get it working? Best regards, Vadim On recent versions of OSX, Apple has by default made it so that all applications must be signed by default. You can disable this behavior through system settings and security. I suspect this is what is stopping it. https://answers.uchicago.edu/25481 Changing of system settings, creation of certificate and signing of GDB executable helped to get gdb debugging working when running from command line. But debugging from Mono-D still fails with the same error.
Re: Any D IDE on Mac OSX with debugging support?
On Monday, 16 November 2015 at 07:48:31 UTC, Rikki Cattermole wrote: On 16/11/15 7:45 PM, Vadim Lopatin wrote: [...] On recent versions of OSX, Apple has by default made it so that all applications must be signed by default. You can disable this behavior through system settings and security. I suspect this is what is stopping it. https://answers.uchicago.edu/25481 Thank you! Let me try that.
Any D IDE on Mac OSX with debugging support?
Hello, Is there any IDE which allows debugging D apps on OSX? I'm trying Mono-D, but getting error "Debugger operation failed A syntax error in expression, near 'sizeof(void*)'" GDB is installed using homebrew. Probably, something is wrong with my gdb. When I'm trying to start debugging using console GDB interface - it fails with message about unsigned application. Is there any instruction how to get GDB working on OSX? Code completion and symbol lookups neither do not work on Mono-D / OSX. Does anyone managed to get it working? Best regards, Vadim
Re: OSX Foundation framework D binding
On Wednesday, 11 November 2015 at 09:29:47 UTC, Daniel Kozak wrote: V Wed, 11 Nov 2015 06:17:00 + Vadim Lopatin via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> napsáno: Hello, I'm working on native Cocoa backend for DlangUI GUI library under OSX. Is there any ready to use bindings for easy accessing Cocoa API? Probably, there is some HelloWorld program which creates window and draws something? Best regards, Vadim I find only this one: http://code.dlang.org/packages/derelict-cocoa Me too. It looks promising. I'll try to use it.
Re: OSX Foundation framework D binding
On Wednesday, 11 November 2015 at 16:04:44 UTC, Jacob Carlborg wrote: On 2015-11-11 17:02, Jacob Carlborg wrote: I would recommend creating new bindings which use the new Objective-C interoperability feature that was added in the latest release (2.069.0). You could use DStep [1] to generate the bindings. It will generate bindings which are not completely compatible with what the compiler can handle. But it can be used as a base. [1] https://github.com/jacob-carlborg/dstep Aren't there any ready set of translated and post-processed files for main OSX foundations in some repository? Could you point at it?
Re: OSX Foundation framework D binding
On Wednesday, 11 November 2015 at 16:04:44 UTC, Jacob Carlborg wrote: On 2015-11-11 17:02, Jacob Carlborg wrote: I would recommend creating new bindings which use the new Objective-C interoperability feature that was added in the latest release (2.069.0). You could use DStep [1] to generate the bindings. It will generate bindings which are not completely compatible with what the compiler can handle. But it can be used as a base. [1] https://github.com/jacob-carlborg/dstep That's interesting. Let me try. Thank you!
OSX Foundation framework D binding
Hello, I'm working on native Cocoa backend for DlangUI GUI library under OSX. Is there any ready to use bindings for easy accessing Cocoa API? Probably, there is some HelloWorld program which creates window and draws something? Best regards, Vadim
Re: ddbc: MySQL/MariaDB: Access Violation
On Monday, 18 May 2015 at 18:54:20 UTC, Suliman wrote: GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; p.s. this command return my: Affected rows: 0 Do you see some stack trace on crash? No. I checked on 2 PC and it's not look like my issue, because result is totally same. If I change void main() to vibed's static this() I get this error. Try running under debugger. See where it's crashed.
Re: ddbc: MySQL/MariaDB: Access Violation
On Sunday, 17 May 2015 at 10:24:43 UTC, Suliman wrote: I am using this driver for access to MariaDB http://code.dlang.org/packages/ddbc The problem that it's work fine when it's used from desktop App, but when I try to run it's from vibed app i get Access Violation. In my.ini I added string: bind-address = 127.0.0.1 Also I run next command: GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; p.s. this command return my: Affected rows: 0 Do you see some stack trace on crash?
Re: Binding to C
On Tuesday, 12 May 2015 at 03:20:34 UTC, TJB wrote: I'm sure this question has been asked a thousand times. I've even asked similar questions in the past (I've been away for quite a while). But all of the tutorials that I have found assume quite a lot and leave a lot to be inferred. Is there a simple step by step tutorial demonstrating how to call C code from D? With the separate file contents and names and compilation instructions? Thanks, TJB Start with http://wiki.dlang.org/Bind_D_to_C http://dlang.org/interfaceToC.html http://dlang.org/htod.html http://wiki.dlang.org/Converting_C_.h_Files_to_D_Modules Best regards, Vadim
Re: Static function template
On Thursday, 7 May 2015 at 10:19:44 UTC, Lemonfiend wrote: Is it not possible to have a static function template with the same name as the non-static version? struct S { int i; auto foo(T)(int j) { i=j; } static auto foo(T)(int j) { S s; s.foo!T(j); return s; } } void main() { auto s = S.foo!bool(1); } Error: need 'this' for 'foo' of type '(int j)' Can be fixed by using of different names for static and non-static function. Not sure why doesn't work w/o this change (compiler bug?) struct S { int i; auto foo2(T)(int j) { i=j; } static S foo(T)(int j) { S s; s.foo2!T(j); return s; } } void main() { auto s = S.foo!bool(1); }
Re: Need help with DLANGUI
On Tuesday, 24 March 2015 at 13:31:06 UTC, Eric wrote: BTW, why do you need FreeImage to create image? Isn't it just possible inside dlangui? This is basically my question. Is there a drawing engine that can draw lines, circles, and shapes as well as single pixels? -Eric Hello, I've implemented CanvasWidget today as convenient way of custom drawing, and added drawPixel and drawLine methods to DrawBuf. See example1 / Canvas tab. Sample code: CanvasWidget canvas = new CanvasWidget(canvas); canvas.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT); canvas.onDrawListener = delegate(CanvasWidget canvas, DrawBuf buf, Rect rc) { buf.fill(0xFF); int x = rc.left; int y = rc.top; buf.fillRect(Rect(x+20, y+20, x+150, y+200), 0x80FF80); buf.fillRect(Rect(x+90, y+80, x+250, y+250), 0x80FF80FF); canvas.font.drawText(buf, x + 40, y + 50, fillRect()d, 0xC080C0); buf.drawFrame(Rect(x + 400, y + 30, x + 550, y + 150), 0x204060, Rect(2,3,4,5), 0x80704020); canvas.font.drawText(buf, x + 400, y + 5, drawFrame()d, 0x208020); canvas.font.drawText(buf, x + 300, y + 100, drawPixel()d, 0x80); for (int i = 0; i 80; i++) buf.drawPixel(x+300 + i * 4, y+140 + i * 3 % 100, 0xFF + i * 2); canvas.font.drawText(buf, x + 200, y + 250, drawLine()d, 0x800020); for (int i = 0; i 40; i+=3) buf.drawLine(Point(x+200 + i * 4, y+290), Point(x+150 + i * 7, y+420 + i * 2), 0x008000 + i * 5); };
Re: Need help with DLANGUI
On Monday, 23 February 2015 at 19:41:30 UTC, Eric wrote: I have been trying out dlanui, and I am able to create an image with FreeImage and display it with an ImageWidget. However this requires that I write the image out to disk, and then load it again to display it. Is there any way I can update or create the image in memory without going to disk? Thanks, Eric Hello, Sorry for delayed answer. Is your question still actual? You can use something like // create RGBA drawing buffer ColorDrawBuffer buf = new ColorDrawBuffer(width, height); // copy pixels into buf from your custom image // . // put into DrawBufRef DrawBufRef imageDrawBuf = buf; // create image drawable DrawableRef myCustomImageDrawable = new ImageDrawable(imageDrawBuf); // set drawable of ImageWidget imageWidget.drawable = myCustomImageDrawable; There was code in dlangui.graphics.image which could copy FreeImage images to ColorDrawBuf, but in recent version it's removed. You can check github revision history to get proper code. BTW, why do you need FreeImage to create image? Isn't it just possible inside dlangui?
Re: DlangUI EditLine question
On Sunday, 15 March 2015 at 16:21:21 UTC, Kyle wrote: I have a variable, x, which I want to update when the content of a DlangUI EditLine is modified. I tried making this work with the onContentChange method listed in the API documentation, but dmd told me it's not there. I've got this working now by implementing a custom subclass of EditLine as below: class XEditLine : EditLine { this(string ID, dstring initialContent = null) { super(ID, initialContent); } override bool onKeyEvent(KeyEvent e) { super.onKeyEvent(e); x = to!double(this.text); return true; } } This works but it seems like there should be a cleaner way to do this, any suggestions? Thanks. You can either override onContentChange or use onContentChangeListener override void onContentChange(EditableContent content, EditOperation operation, ref TextRange rangeBefore, ref TextRange rangeAfter, Object source) { super.onContentChange(content, operation, rangeBefore, rangeAfter, source); // do something x = to!double(this.text); } or EditLine line = new EditLine(); line.onContentChangeListener = delegate(EditableContent) { // do something x = to!double(line.text); } of a DlangUI EditLine is modified. I tried making this work with the onContentChange method listed in the API documentation, but dmd told me it's not there. I've got this If you don't see onContentChange method, probably you have older version of DlangUI. Try dub upgrade --force-remove
Re: Invoking MAGO debugger
On Thursday, 26 February 2015 at 18:37:17 UTC, michaelc37 wrote: On Thursday, 26 February 2015 at 10:20:31 UTC, Vadim Lopatin wrote: Hello! I'm trying to integrate MAGO into DlangIDE. I can easy create instance of MAGO DebugEngine, but having problems with obtaining of IDebugPort which is needed for invoking of LaunchSuspended. It looks like to get IDebugPort, I need IDebugCoreServer2 instance. Does anybody know how to do it? Normally, it's being created by VisualStudio AFAIK. Best regards, Vadim I once remember pulling out my hair trying todo the same in order to get it to work with a monodevelop win32 debugger addon. It resulted in a writing new clr wrapper with a different exposed interface https://github.com/aBothe/MagoWrapper e.g. of how the debugee was was launched here: https://github.com/aBothe/MagoWrapper/blob/master/DebugEngine/MagoWrapper/NativeDebugger.cpp Thank you a lot! BTW, it's not clear what license in used for MagoWrapper. In readme, it's said that it's under GPL2, but everywhere in source code I see Apache license.
Invoking MAGO debugger
Hello! I'm trying to integrate MAGO into DlangIDE. I can easy create instance of MAGO DebugEngine, but having problems with obtaining of IDebugPort which is needed for invoking of LaunchSuspended. It looks like to get IDebugPort, I need IDebugCoreServer2 instance. Does anybody know how to do it? Normally, it's being created by VisualStudio AFAIK. Best regards, Vadim
DDOX question
Hello! I'm trying to generate documentation for a library. I like result of DDOX generation - nice navigation by modules and classes. But I cannot figure out how to generate custom pages (e.g. from .dd .d Ddoc), and how to add links to custom pages to all generated pages, e.g. like on Vibe.d documentation site. Could someone point on example or docs wich can help me? Best regards, Vadim
Customization of DUB build=DDOX output
Hello, I'm trying to use DDOX to generate documentation pages for my library (dlangui). dub --build=ddox produces nice output with navigation by modules, but I cannot find out how to embed some custom navigation pane on all pages. E.g. put links to some additional pages like downloads, screenshots, github... Is it possible to do it using dub+ddox build? Best regards, Vadim