]> git.tdb.fi Git - libs/gltk.git/log
libs/gltk.git
11 years agoRemove obsolete inside checks
Mikko Rasa [Wed, 16 Oct 2013 12:12:39 +0000 (15:12 +0300)]
Remove obsolete inside checks

11 years agoMake the DISABLED state actually do something
Mikko Rasa [Wed, 16 Oct 2013 12:09:25 +0000 (15:09 +0300)]
Make the DISABLED state actually do something

11 years agoMake List::set_selected_index a no-op if that item was already selected
Mikko Rasa [Wed, 16 Oct 2013 12:04:49 +0000 (15:04 +0300)]
Make List::set_selected_index a no-op if that item was already selected

11 years agoSupport different font colors in different states
Mikko Rasa [Sun, 22 Sep 2013 15:06:00 +0000 (18:06 +0300)]
Support different font colors in different states

11 years agoAdd a shortcut for defining normal graphic
Mikko Rasa [Sun, 22 Sep 2013 15:05:03 +0000 (18:05 +0300)]
Add a shortcut for defining normal graphic

11 years agoAdd some utility functions for dealing with widget hierarchy
Mikko Rasa [Thu, 8 Aug 2013 16:02:10 +0000 (19:02 +0300)]
Add some utility functions for dealing with widget hierarchy

11 years agoAdd datafile statement for image widgets
Mikko Rasa [Tue, 30 Jul 2013 15:56:09 +0000 (18:56 +0300)]
Add datafile statement for image widgets

11 years agoEnsure that list items are autosized properly in all cases
Mikko Rasa [Sun, 14 Jul 2013 12:01:28 +0000 (15:01 +0300)]
Ensure that list items are autosized properly in all cases

11 years agoRetain position when autosizing widget
Mikko Rasa [Sun, 14 Jul 2013 11:20:17 +0000 (14:20 +0300)]
Retain position when autosizing widget

11 years agoFix an uninitialized variable
Mikko Rasa [Fri, 5 Jul 2013 15:27:34 +0000 (18:27 +0300)]
Fix an uninitialized variable

11 years agoUse a different approach for custom item widgets
Mikko Rasa [Sun, 30 Jun 2013 21:03:38 +0000 (00:03 +0300)]
Use a different approach for custom item widgets

Subclassed widgets can't be loaded from datafiles without providing custom
statements.  Dropdown doesn't allow changing the type of the List either.

11 years agoFix a comparison that let an off-by-one error in
Mikko Rasa [Sun, 30 Jun 2013 21:01:57 +0000 (00:01 +0300)]
Fix a comparison that let an off-by-one error in

11 years agoRefresh list items one at a time
Mikko Rasa [Sun, 30 Jun 2013 20:59:03 +0000 (23:59 +0300)]
Refresh list items one at a time

A blanket update doesn't work so well with items as widgets.

11 years agoRecreate list items when setting data
Mikko Rasa [Sun, 30 Jun 2013 20:41:19 +0000 (23:41 +0300)]
Recreate list items when setting data

11 years agoSome new datafile keywords
Mikko Rasa [Fri, 28 Jun 2013 20:20:49 +0000 (23:20 +0300)]
Some new datafile keywords

11 years agoUnify the behavior of value change signals
Mikko Rasa [Thu, 27 Jun 2013 14:25:50 +0000 (17:25 +0300)]
Unify the behavior of value change signals

All widgets with such signals now emit them if the value is changed
programmatically, but only if it actually changed.

11 years agoAdd getter for Panel::layout
Mikko Rasa [Thu, 27 Jun 2013 14:23:41 +0000 (17:23 +0300)]
Add getter for Panel::layout

This is necessary for certain operations on a panel loaded from a
datafile.

11 years agoProperly set expand flags in LinearArrangement
Mikko Rasa [Thu, 27 Jun 2013 13:37:33 +0000 (16:37 +0300)]
Properly set expand flags in LinearArrangement

11 years agoFix some alignment issues in LinearArrangement
Mikko Rasa [Thu, 27 Jun 2013 13:37:19 +0000 (16:37 +0300)]
Fix some alignment issues in LinearArrangement

11 years agoThe slack column counter needs to be outside the slot loop
Mikko Rasa [Thu, 27 Jun 2013 13:36:09 +0000 (16:36 +0300)]
The slack column counter needs to be outside the slot loop

11 years agoAdd a function to find the index of an item in ListDataStore
Mikko Rasa [Wed, 26 Jun 2013 21:25:52 +0000 (00:25 +0300)]
Add a function to find the index of an item in ListDataStore

11 years agoAdd DragHandle widget
Mikko Rasa [Wed, 26 Jun 2013 18:47:13 +0000 (21:47 +0300)]
Add DragHandle widget

11 years agoDon't trigger widget rebuild if only its position changes
Mikko Rasa [Wed, 26 Jun 2013 17:09:55 +0000 (20:09 +0300)]
Don't trigger widget rebuild if only its position changes

11 years agoRefactor widget autosizing
Mikko Rasa [Wed, 26 Jun 2013 16:17:54 +0000 (19:17 +0300)]
Refactor widget autosizing

Widget::autosize is no longer virtual.  Instead there's autosize_special,
which handles one part at a time.  This way all the important checks and
finalisations are done in one place.

11 years agoAdd a persistent view size attribute to List
Mikko Rasa [Wed, 26 Jun 2013 11:24:08 +0000 (14:24 +0300)]
Add a persistent view size attribute to List

11 years agoImprove widget part caching
Mikko Rasa [Tue, 25 Jun 2013 22:12:19 +0000 (01:12 +0300)]
Improve widget part caching

A single mesh can now hold multiple parts if they share the same texture.

11 years agoAutosize all items in a List
Mikko Rasa [Tue, 25 Jun 2013 18:45:00 +0000 (21:45 +0300)]
Autosize all items in a List

11 years agoSome fixes to the Build file
Mikko Rasa [Sun, 16 Jun 2013 20:25:30 +0000 (23:25 +0300)]
Some fixes to the Build file

11 years agoAvoid autosizing widgets with no style
Mikko Rasa [Sun, 16 Jun 2013 20:21:55 +0000 (23:21 +0300)]
Avoid autosizing widgets with no style

11 years agoDon't divide by zero when autosizing a List with no items
Mikko Rasa [Sun, 16 Jun 2013 20:21:21 +0000 (23:21 +0300)]
Don't divide by zero when autosizing a List with no items

11 years agoAdd a Stack arrangement
Mikko Rasa [Sun, 16 Jun 2013 20:06:43 +0000 (23:06 +0300)]
Add a Stack arrangement

11 years agoAdd a packing attribute to consider a widget even if it's hidden
Mikko Rasa [Sun, 16 Jun 2013 19:59:20 +0000 (22:59 +0300)]
Add a packing attribute to consider a widget even if it's hidden

11 years agoAllow loading generic layout properties from datafiles
Mikko Rasa [Sun, 16 Jun 2013 19:33:52 +0000 (22:33 +0300)]
Allow loading generic layout properties from datafiles

11 years agoSupport widget expansion in linear layouts
Mikko Rasa [Sun, 16 Jun 2013 12:03:48 +0000 (15:03 +0300)]
Support widget expansion in linear layouts

11 years agoCombine common parts of Column and Row into LinearArrangement
Mikko Rasa [Sun, 16 Jun 2013 09:17:17 +0000 (12:17 +0300)]
Combine common parts of Column and Row into LinearArrangement

11 years agoAdd some sanity checks to arrangements
Mikko Rasa [Sun, 16 Jun 2013 08:26:58 +0000 (11:26 +0300)]
Add some sanity checks to arrangements

11 years agoSupport specifying layouts in datafiles
Mikko Rasa [Sat, 15 Jun 2013 21:34:53 +0000 (00:34 +0300)]
Support specifying layouts in datafiles

11 years agoSupport loading dialog action buttons
Mikko Rasa [Sat, 15 Jun 2013 21:00:30 +0000 (00:00 +0300)]
Support loading dialog action buttons

11 years agoReplace the derived layout classes with a more flexible design
Mikko Rasa [Fri, 14 Jun 2013 20:32:37 +0000 (23:32 +0300)]
Replace the derived layout classes with a more flexible design

The new Arrangement interface allows multiple arrangements to be used in
a single layout.  They can even be nested, with a sub-arrangement acting
like a single slot of its parent.

11 years agoUse DerivedObjectLoader for widget loaders
Mikko Rasa [Fri, 14 Jun 2013 17:11:18 +0000 (20:11 +0300)]
Use DerivedObjectLoader for widget loaders

11 years agoRemove the Table widget
Mikko Rasa [Fri, 14 Jun 2013 16:09:46 +0000 (19:09 +0300)]
Remove the Table widget

The layout system made it rather useless, and it suffered from similar
styling problems as List did before widget-based items.

11 years agoAdd constraint types that allow flexible spacing between widgets
Mikko Rasa [Wed, 12 Jun 2013 12:49:45 +0000 (15:49 +0300)]
Add constraint types that allow flexible spacing between widgets

11 years agoSmarter way of complementing constraint types
Mikko Rasa [Wed, 12 Jun 2013 09:55:54 +0000 (12:55 +0300)]
Smarter way of complementing constraint types

11 years agoProperly filter out duplicate constraints
Mikko Rasa [Wed, 12 Jun 2013 09:55:04 +0000 (12:55 +0300)]
Properly filter out duplicate constraints

11 years agoTurn List items into widgets
Mikko Rasa [Tue, 11 Jun 2013 19:33:25 +0000 (22:33 +0300)]
Turn List items into widgets

This takes somewhat more resources, but offers much greader flexibility.
Items can be styled more freely and can contain pretty much anything.

11 years agoRefactor pointer event handling in Container
Mikko Rasa [Tue, 11 Jun 2013 15:47:10 +0000 (18:47 +0300)]
Refactor pointer event handling in Container

11 years agoMore flexible storage for Lsit and Dropdown items
Mikko Rasa [Mon, 10 Jun 2013 19:58:28 +0000 (22:58 +0300)]
More flexible storage for Lsit and Dropdown items

In many cases these widgets are used to pick an object.  Previously, the
calling code needed to explicitly maintain synchronization between the
objects and list contents.  This change allows the list to actually hold
pointers to the objects, making the retrieval of the selected object
vastly easier.

11 years agoAdd keywords to specify horizontal / vertical sides at once
Mikko Rasa [Sun, 9 Jun 2013 19:34:37 +0000 (22:34 +0300)]
Add keywords to specify horizontal / vertical sides at once

11 years agoAdd properties to Entry for specifying autosize dimensions
Mikko Rasa [Sun, 9 Jun 2013 18:42:44 +0000 (21:42 +0300)]
Add properties to Entry for specifying autosize dimensions

11 years agoConsider part margins when autosizing
Mikko Rasa [Sun, 9 Jun 2013 15:07:09 +0000 (18:07 +0300)]
Consider part margins when autosizing

11 years agoDon't accept characters in Entry if there hasn't been a key press first
Mikko Rasa [Sun, 9 Jun 2013 15:06:58 +0000 (18:06 +0300)]
Don't accept characters in Entry if there hasn't been a key press first

This rectifies a problem where a program reacts to a key press event by
focusing an Entry, which then receives the associated character event.

11 years agoSet expand flag in Row and Column layouts on all widgets
Mikko Rasa [Tue, 4 Jun 2013 19:13:31 +0000 (22:13 +0300)]
Set expand flag in Row and Column layouts on all widgets

11 years agoAvoid putting tooltip label in layout
Mikko Rasa [Tue, 4 Jun 2013 19:12:04 +0000 (22:12 +0300)]
Avoid putting tooltip label in layout

11 years agoComment and style updates
Mikko Rasa [Wed, 29 May 2013 20:21:46 +0000 (23:21 +0300)]
Comment and style updates

11 years agoImplement set_size and set_position in terms of set_geometry
Mikko Rasa [Wed, 29 May 2013 20:20:26 +0000 (23:20 +0300)]
Implement set_size and set_position in terms of set_geometry

11 years agoRestore parent to 0 if an exception occurs while setting things up
Mikko Rasa [Wed, 29 May 2013 20:17:00 +0000 (23:17 +0300)]
Restore parent to 0 if an exception occurs while setting things up

This prevents an inconsistent state from forming if something goes wrong.

11 years agoRemove deprecated alias from Style loader
Mikko Rasa [Wed, 29 May 2013 20:05:49 +0000 (23:05 +0300)]
Remove deprecated alias from Style loader

11 years agoCheck the return value of open_from_sources since it no longer throws
Mikko Rasa [Wed, 29 May 2013 20:04:50 +0000 (23:04 +0300)]
Check the return value of open_from_sources since it no longer throws

11 years agoIgnore hidden widgets when solving a layout
Mikko Rasa [Wed, 29 May 2013 20:00:10 +0000 (23:00 +0300)]
Ignore hidden widgets when solving a layout

At the moment this causes any constraints involving them to be ignored,
which may break constraint chains.

11 years agoThe entire row should be divided when initially making a column basic
Mikko Rasa [Wed, 29 May 2013 19:12:11 +0000 (22:12 +0300)]
The entire row should be divided when initially making a column basic

Failing to do so will alter the row's meaning if the nonzero value in the
column is anything else than 1.0.

11 years agoTake a Window pointer along with custom input devices
Mikko Rasa [Sun, 24 Mar 2013 15:42:16 +0000 (17:42 +0200)]
Take a Window pointer along with custom input devices

11 years agoGuard against null pointers
Mikko Rasa [Sun, 24 Mar 2013 15:32:01 +0000 (17:32 +0200)]
Guard against null pointers

11 years agoDon't let input events that are passed to widgets go to other consumers
Mikko Rasa [Sun, 24 Mar 2013 15:27:30 +0000 (17:27 +0200)]
Don't let input events that are passed to widgets go to other consumers

This was removed with event handling changes a while back, because other
changes needed to be made in libmspgui before reimplementation was
possible.

11 years agoFix a 64-bit compilation problem
Mikko Rasa [Wed, 16 Jan 2013 17:02:50 +0000 (19:02 +0200)]
Fix a 64-bit compilation problem

11 years agoReintroduce the Resources constructor that immediately loads a file
Mikko Rasa [Wed, 16 Jan 2013 16:58:51 +0000 (18:58 +0200)]
Reintroduce the Resources constructor that immediately loads a file

This covers many simple use cases and avoids the need of creating a
sub-class to add sources or load data before a Root is created.

11 years agoRestore ability to handle raw image files
Mikko Rasa [Wed, 16 Jan 2013 16:53:58 +0000 (18:53 +0200)]
Restore ability to handle raw image files

11 years agoFix some problems with List and Dropdown
Mikko Rasa [Wed, 26 Dec 2012 20:13:01 +0000 (22:13 +0200)]
Fix some problems with List and Dropdown

They probably still don't work perfectly, but there's bigger changes
coming when I have time.

11 years agoMiscellaneous improvements for handling graphics
Mikko Rasa [Sat, 15 Dec 2012 18:13:58 +0000 (20:13 +0200)]
Miscellaneous improvements for handling graphics

11 years agoAllow specifying a custom spacing for a constraint
Mikko Rasa [Sat, 15 Dec 2012 18:11:56 +0000 (20:11 +0200)]
Allow specifying a custom spacing for a constraint

11 years agoInitial implementation of middle gravity
Mikko Rasa [Sat, 15 Dec 2012 16:23:25 +0000 (18:23 +0200)]
Initial implementation of middle gravity

This implementation is unsuitable for centering a group of widgets.  I
have a better one in mind, but no time to implement it now.

11 years agoBump version
Mikko Rasa [Sun, 9 Dec 2012 17:39:44 +0000 (19:39 +0200)]
Bump version

Source compatibility was broken by commit 91997dd two years ago.

11 years agoUpdate loaders to use ObjectLoader as base class
Mikko Rasa [Sat, 8 Dec 2012 10:24:27 +0000 (12:24 +0200)]
Update loaders to use ObjectLoader as base class

11 years agoFont size loading fixes
Mikko Rasa [Sat, 8 Dec 2012 00:03:50 +0000 (02:03 +0200)]
Font size loading fixes

When a font is specified, reset font size as well.

Add a font_size statement for overriding the size.

11 years agoAllow Root widgets to be created with custom input devices
Mikko Rasa [Fri, 7 Dec 2012 18:59:43 +0000 (20:59 +0200)]
Allow Root widgets to be created with custom input devices

11 years agoImplement the Layout::set_spacing function and friends
Mikko Rasa [Fri, 7 Dec 2012 10:28:59 +0000 (12:28 +0200)]
Implement the Layout::set_spacing function and friends

11 years agoChange Style so it doesn't need a special loading function
Mikko Rasa [Sun, 2 Dec 2012 21:38:30 +0000 (23:38 +0200)]
Change Style so it doesn't need a special loading function

11 years agoRemove file lookup from Resources since a better mechanism exists now
Mikko Rasa [Sun, 2 Dec 2012 17:27:05 +0000 (19:27 +0200)]
Remove file lookup from Resources since a better mechanism exists now

11 years agoMove all child widget handling into Container
Mikko Rasa [Sun, 2 Dec 2012 09:44:11 +0000 (11:44 +0200)]
Move all child widget handling into Container

This solves some problems like the slider of a list not receiving pointer
enter/leave events.  There are no obvious downsides either.  Widgets can
always override event handlers if they want to prevent something from
happening.

The event handlers are currently just combinations of those of the Panel
and Container classes.  They'll be smoothed out shortly.

11 years agoRemove dead code from Panel::Child
Mikko Rasa [Sun, 2 Dec 2012 08:51:46 +0000 (10:51 +0200)]
Remove dead code from Panel::Child

11 years agoRemove the extraneous and deprecated header component from Build file
Mikko Rasa [Fri, 30 Nov 2012 21:07:45 +0000 (23:07 +0200)]
Remove the extraneous and deprecated header component from Build file

11 years agoReplace default_size -> native_size in the example font file
Mikko Rasa [Fri, 30 Nov 2012 21:07:11 +0000 (23:07 +0200)]
Replace default_size -> native_size in the example font file

11 years agoUse a GL::Renderer to render widgets
Mikko Rasa [Fri, 30 Nov 2012 20:58:52 +0000 (22:58 +0200)]
Use a GL::Renderer to render widgets

This eliminates a lot of texture and matrix thrashing.

11 years agoCache widget parts in meshes
Mikko Rasa [Fri, 30 Nov 2012 20:21:55 +0000 (22:21 +0200)]
Cache widget parts in meshes

This initial implementation is rather rough, but it paves the way for
using GL::Renderer.  It uses a lot of VBOs and is generally less efficient
than it could, but those will be addressed in the near future.  All
widgets haven't been tested, but the helloworld example works.

11 years agoAdd protected functions for manipulating widget state
Mikko Rasa [Fri, 30 Nov 2012 17:57:46 +0000 (19:57 +0200)]
Add protected functions for manipulating widget state

11 years agoReturn a reference from Style::get_font
Mikko Rasa [Wed, 28 Nov 2012 19:45:30 +0000 (21:45 +0200)]
Return a reference from Style::get_font

Styles always have a font, so the returned value could never be null.

11 years agoMake font size a property of Style
Mikko Rasa [Wed, 28 Nov 2012 18:34:54 +0000 (20:34 +0200)]
Make font size a property of Style

11 years agoBind the font texture in Text::render
Mikko Rasa [Wed, 28 Nov 2012 18:29:04 +0000 (20:29 +0200)]
Bind the font texture in Text::render

12 years agoAdd autosizing for panels
Mikko Rasa [Tue, 27 Nov 2012 21:58:07 +0000 (23:58 +0200)]
Add autosizing for panels

It still does a lot of unnecessary layout updates, but seems to work at
least in basic cases.

12 years agoDon't try to solve if container is smaller than its margins
Mikko Rasa [Tue, 27 Nov 2012 21:52:39 +0000 (23:52 +0200)]
Don't try to solve if container is smaller than its margins

Attempting that would cause unsigneds to wrap around to very large values
and cause a weird solution.

12 years agoMake LinearProgram robust against degenerate solutions
Mikko Rasa [Tue, 27 Nov 2012 21:43:34 +0000 (23:43 +0200)]
Make LinearProgram robust against degenerate solutions

If the container is exactly the size required by the widgets, there will
be redundant equations, which causes a degeneracy in the phase 1 solution.

12 years agoReport non-basic variables in Layout::LinearProgram as having zero value
Mikko Rasa [Tue, 27 Nov 2012 11:04:39 +0000 (13:04 +0200)]
Report non-basic variables in Layout::LinearProgram as having zero value

12 years agoUpdate layout when panel's geometry changes
Mikko Rasa [Tue, 27 Nov 2012 08:22:30 +0000 (10:22 +0200)]
Update layout when panel's geometry changes

12 years agoFix a crash if the linear program contains an empty column
Mikko Rasa [Tue, 27 Nov 2012 07:38:29 +0000 (09:38 +0200)]
Fix a crash if the linear program contains an empty column

12 years agoStore autosized geom in Layout::Slot
Mikko Rasa [Tue, 27 Nov 2012 07:36:36 +0000 (09:36 +0200)]
Store autosized geom in Layout::Slot

This avoids having to autosize all widgets in the layout every time one of
them changes, and allows checking whether an update is actually needed.

12 years agoSome cleanup in Layout
Mikko Rasa [Mon, 26 Nov 2012 19:04:36 +0000 (21:04 +0200)]
Some cleanup in Layout

12 years agoImprove comments of the Layout class
Mikko Rasa [Mon, 26 Nov 2012 18:20:00 +0000 (20:20 +0200)]
Improve comments of the Layout class

Add some code comments to describe how the constraints are built and how
the different parts of the simplex method work.  They don't entirely
explain the algorithm, but should help understanding the code.

Minor fixes to the documentation.

12 years agoMiscellaneous other fixes
Mikko Rasa [Wed, 21 Nov 2012 15:58:11 +0000 (17:58 +0200)]
Miscellaneous other fixes

12 years agoAdapt to Collection API changes
Mikko Rasa [Wed, 21 Nov 2012 15:57:44 +0000 (17:57 +0200)]
Adapt to Collection API changes

12 years agoAdjust event handling to match changes in mspgui
Mikko Rasa [Wed, 21 Nov 2012 15:56:49 +0000 (17:56 +0200)]
Adjust event handling to match changes in mspgui

12 years agoRework exceptions and use maputils
Mikko Rasa [Wed, 21 Nov 2012 15:30:10 +0000 (17:30 +0200)]
Rework exceptions and use maputils