Is it possible to create table(mathematical table not kitchen table) by using glui? Please specify the function, if possible.
Thanks in advance.
From my experience with glui, and looking over the docs again, there doesn't seem to be a way to create a table.
One option is to just pack read only text boxes in a regular grid.. That would sort of poorly mimic a table.
Another option if you are getting to a point where glui simply isn't powerful enough is to switch to something like gtk or gtkmm. It would still allow you to render opengl (through gtkglext), but it would also enable you to use all of the gtk widgets (here's a gallery: http://library.gnome.org/devel/gtk/2.21/ch02.html -- not that I see a table there either).
Again from my experience, gtk is quite a bit harder to start using as compared to glui, but i think it's worth the effort for an involved gui.
Related
I just started developing an MFC application for the first time and I'm hoping to get more familiar with the whole "controls" concept. I am using the dialog editor in visual studio and so far I was not able to find functionality to add a simple table/grid. It seems quite basic to me, but I can't even find reliable information on how to do it on the internet.
I am looking for something similar to Qt's QTableWidget, something that I can later program with variable amount of rows and columns tailored to my application's use cases.
Do you have any ideas how to do it?
I use CGridCtrl which is very powerful and does a lot of the legwork for you.
Sounds like you're after a List View Control, which is wrapped by MFC's CListCtrl class. The dialog editor will enable you to add one and set its properties.
I've just downloaded GtkD, and I'm trying to find some resources online to help me learn it. However, most of what I find is either for GTK+ (which looks very different to GtkD syntactically), or is very limited in its scope (such as this). Are there any resources out there I have missed? How much help would learning GTK+ be to understanding GtkD? From what I can tell, they look quite different in terms of code.
Well, my answer will not go far from 'nothing at all', but maybe it'll be of some use.
GtkD is basically a wrapper around GTK+. That means, that there's almost a one-to-one correspondence between its functions. Also, this means that the object models are exactly the same.
E.g. there are such entities like windows, buttons, etc. Those have some relations, like, button can be placed on a window. Conceptually, all of those objects and relations are exactly the same for both GtkD and GTK+ (v3.x).
And for a GUI toolkit this object model is the most important thing to study and understand. Also, it's the biggest thing. So, if you understand this model: what objects there are and how they can be used together - you'll be successful in writing GUI apps using either GTK+ or GtkD.
The syntactical difference you'll need to overcome is pretty trivial compared to this.
I would suggest to use the GTK+ documentation when looking for how-to-do-stuff and use the GtkD documentation to understand how those concepts are implemented in D. E.g. in GTK+ v2.x to add a button on a window you use something like
gtk_container_add (GTK_CONTAINER (window), button);
and in GtkD you can do the same by
window.add(button);
In other situations it can be a bit more complex and not that straightforward at first, but will be more and more easy when you get some experience.
Upon further digging, I discovered this (very handy!) series of tutorials on GtkD here.
I've used Qt for some time and now I want to try Gtk. I want to write simple database application, but it looks like there is no support for sql (I'm forced to fill manually model with data). In Qt we have QSqlQueryModel and QSqlTableModel, QTableView and QTreeView. Gtk approach is more like QTableWidget and QTreeWidget. I need somehow connect to the database, get data and fill the model. Ok, but what if my table is really big? How can I implement in-place editing (Gtk model can't modify data)? Can I chain models to provide filtering like QSortFilterProxyModel? These are basic things that I use all the time writing database applications with Qt. How this can be done with Gtk?
GTK+ is more modularized than Qt, so you'll need to look up your requirements in the GObject ecosystem. libgda is what you are looking for.
Here is a non-exhaustive overview of the platform for future references.
GTK literally stands for GIMP Toolkit. It's pretty much a purely graphically set of tools for developing GUI applications, Qt on the other hand is a graphics and a whole other stack on top for databases and so on. Your best starting point is working out what DB you're going to use, then getting the development package (if it has C++ bindings), and go through the API docs for it and you'll mostly be building the functionality on your own. There's other database abstraction layers out there, so that's another route you could take.
OK, so my Windows application involves a window that, among other things, has a list of objects in a pane. Each object has 8 boolean values that need to be determined — so I'd like a list of the objects, with eight columns of checkboxes after. I'm not using MFC, should that be relevant.
ListView looks the way I want it to, but apparently it doesn't accept checkboxes in SubItems (the LVS_EX_CHECKBOXES style only gives each row a checkbox on the left).
So what I need is some kind of alternative to ListView that does allow this. I've been looking, but nothing I've found seems to work.
I have seen reference to some DataGridView control, but I don't see that as an option in my Visual Studio 2010 "toolbox" — how does one access it, is it even available for non-MFC C++ projects? Most references to it seem to be for VB or C#.
Another thing I found is is this custom ListView, but it, again, seems to be for C# and not C++. I'd certainly accept suggestions on how to use this resource in my code, if there's a simple way to interface with the C# dialogue (I'm completely unfamiliar with C#).
Anyway, any thoughts, suggestions, or tips anyone has, would be most appreciated!
EDIT: This should maybe go in a new question, but it doesn't really seem deserving an entire question on its own: MFC seems to have more support for this kind of thing (insofar as most of the custom controls I can find to download are for MFC). My project does not actually require being non-MFC, it just is, at the moment. How much work am I looking at to convert it?
Well, I've taken the plunge and started using MFC; the CGridCtrl I downloaded seems to be working pretty well, though I still have a lot of work on it. I'm going to call this the answer, then, since there doesn't seem to be another forthcoming.
I am wondering which way is the best to start building a GUI+SOFT in Qt. I am trying to build a sound media player based on a MVC pattern. Until now i have found 3 ways to do so.
1- Should I use a .ui file thanks to Qt designer, is it flexible enough ?
2- Should I use QML to make the design than integrate it to a C++ development ?
3- Should I just start from scratch and do it by hand without Qt Designer and using Qt library ?
Thank you very much for your answers.
NOTE: I'm using PyQt, so my comment may not be the most relevant.
I found Qt Designer to be great to create UIs, but then, when comes the time to modify them later, it becomes somewhat of a problem. Inserting new elements in an existing layout is often tricky, and you have to break all your layouts and re-assemble them (hoping you didn't mess anything up). Moreover, if your app is not trivial, you'll likely end up with code "fixing" what the .ui can't do. There are other tricky cases like that, but I don't remember them right now.
I ended up getting rid of my .ui files. So what I'd recommend is to initially use the designer to create the UI, and then use only the generated code from that point forward.
If you want your UI to be animated and it is not a requirement to follow platform UI appearance, QML is by far the best way to achieve this. If you want a UI that appears like any other application on your system and has limited animation then stick with QtDesigner and standard widgets.
I prefer building UI completely from scratch. This gives a lot of flexibility and better understanding of what is where, but on the other hand changing layout sometimes is a big headache.
I would use Qt Designer, as this is the easiest method IMHO.