Git Product home page Git Product logo

gwork's People

Contributors

ananace avatar billyquith avatar deekayht avatar expl0it3r avatar garrynewman avatar grant1219 avatar jamiehales avatar jeremieroy avatar kklouzal avatar megaxela avatar okonk avatar qehgt avatar sfinktah avatar simonboorer avatar topblast avatar voodooattack avatar wseng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gwork's Issues

Renderer: OpenGL

Add GLFW cross platform GL rendered. Current OpenGL renderer relies on Windows API.

Create data driven skin

Includes:

  • Texture UVs are currently hardcoded into the skin ('Init(...)). Move these to a file and read at runtime. This would allow an external tool to edit them.
  • Colours are read from skin texture. Move these to a file as need to edit the texture to change the colour.
  • Fonts could also be read from config file.
  • Config file might be like CSS. Perhaps JSON file with cascade overrides.

Since skinning is quite a lot of code and many values (e.g. colours) are hardcoded into GWEN code this would be best done in a branch, creating a new skin type, and comparing the results with the unchanged branch. For this it would be useful to have automated screen capture comparisons.

Refactor event system

Currently the event system is very inefficient memory-wise. Each control contains many listeners which may never be used and cache data that is never used. This could be much improved using a centralised hash lookup type system.

Not an immediate priority. Can be done after Ponder work.

MinGW does support CODECVT

As mentioned in my comment the following logic makes it that AVOID_CPP11_CODECVT is always set when using a MinGW compiler, even though MinGW also supports codecvt (probably starting from GCC 5.1 upwards as well).

#if ((defined(__GNUC__) && !(__GNUC__ >= 5 && __GNUC_MINOR__ > 1)) \
     || defined(__MINGW32__)) \
    && !defined(__APPLE__)
 #   define AVOID_CPP11_CODECVT
 #endif

The easy fix could be to just remove the __MINGW32__ check since the GNUC check should work for MinGW as well.

Furthermore MinGW doesn't seem to support the alloca.h header, so when someone would be using an older compiler the else branch would fail to compile.

// Note: <codecvt> is C++11. It exists in libc++ (LLVM) but is patchy in libstdc++ pre-GCC 5
#ifndef AVOID_CPP11_CODECVT
#   include <codecvt>      // Narrow/widen - C++11
#else
#   include <iconv.h>
#   include <alloca.h>
#endif

One fix I saw is to use malloc.h for Windows.

Relevant file: https://github.com/billyquith/GWork/blob/gwork/source/gwork/source/Utility.cpp

On a personal note: I find the double "negation" a bit confusing. Why define a Marco called "AVOID_X" and the check whether it's NOT defined? But that's maybe just me. 😉

Text entry cursor inaccurate

The text entry cursor seems to jump around. Where there is a space is can go backwards when it should go forwards.

Properties height calculation

When you have bigger text as the label in a Properties row, it is clipped. The height does not take this into account.

Allegro keyboard input handling logic

I have found a small bug when entering text, which sometimes causes modifier keys to input characters.

https://github.com/billyquith/GWork/blob/gwork/source/platform/include/Gwork/Input/Allegro5.h#L122-L123

I believe there should be some extra bounds checking done there before passing the character to InputCharacter, unless InputCharacter is not only for visible characters.

http://liballeg.org/a5docs/trunk/events.html#allegro_event_key_char

It seems like sometimes non-character keys can generate strange values for unichar. An example of this is on Mac OSX the command key inputs a "j" character in textboxes. I will look into fixing this, but let me know if I am missing a larger issue.

Fix cmake CMP0004 deprecation warning

CMake Deprecation Warning at CMakeLists.txt:5 (cmake_policy):
  The OLD behavior for policy CMP0004 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

Add text length limit on TextBox control

Hi, I'd like to add a text length limit to the TextBox control, but I see there's a few possible complications here.

  1. Where to do the change? I think doing it on the TextBox control makes the most sense since the purpose of this limit is to limit the amount of text a user can enter.

  2. Naming of things relating to the limit. Do you have a preferred name? Right now I'm using SetMaxTextLength/GetMaxTextLength/m_maxTextLength.

  3. What should the behaviour be when editing text and the cursor isn't at the end? For example suppose the limit is set to 5. The current text is "12345" and the cursor is between the 3 and 4. Now you type 'a'. What is the result? Is it "12345" since the limit is met and you can't add any more text? Is it "123a4" bumping the 5 off the end?

  4. Similar scenario to the above, but instead 4 is highlighted. Your clipboard contains "ab" and you paste. What is the result? "12345"? "123ab"?

  5. As above in 4, but what if the clipboard only contained 'a'?

  6. Should the limit apply to the subclasses of TextBox? If this applies to TextBoxMultiline, should the '\n' characters count towards the limit? For ease of implementation I would probably just say yes it should apply to subclasses, and newlines do count towards the limit.

Thinking about it some more, questions 3-5 come down to the behavior of should the limit be the limit and if the user wants to insert in the middle they have to take characters off the end first? Or if you insert in the middle should it bump characters off the end?

I just did a quick test with an HTML input box (jsfiddle) and essentially the limit is the limit. It doesn't do any bumping.

Am I missing anything else?

Cross Platform Debug Break

While trying to get GWork running on Windows with a MinGW x64 compiler, I've run into a compiler issue with the _asm { int 3 } code that is basically a break point. While looking for how to make this better and cross platform I learned that it's not exactly that easy. For our case we could for GCC (and clang?) we could go with __builtin_trap() and for MSVC use __debugbreak(). Or as an alternative we could use the header file provided by Scott Tsai which has been tested for many platforms and works around possible issues.

What do you think?

TTF_Quit(); crash fix in SDL2Sample.cpp

Nice work on the SDL port .
Anyway to fix this crash just add **skin.ReleaseFont(skin.GetDefaultFont());**👍
SDL_DestroyWindow(window); SDL_Quit(); skin.ReleaseFont(skin.GetDefaultFont()); TTF_Quit();

One more thing
In windows "DefaultSkin.png" and "OpenSans.ttf" will fail to load
The following will fix it 👍
`
#ifdef _WINDOWS
#include <windows.h>
#endif

...
...
#ifdef _WINDOWS
char * dir = SDL_GetBasePath();
SetCurrentDirectory(dir);
#endif

`

Query: how to resize the GUI to follow the window

What methods and where do you call them in order to get the GUI layout resized correctly with the host window? I use OpenGL with GLFW, on MSW.
I used the test below, but none of my attempts produced anything meaningful; eventually crashed the example application:

static Gwk::Controls::Canvas* canvas;
static TestFrame* testFrame;

static void framebuffer_size_callback(GLFWwindow* w, int width, int height) {

//    canvas->SetBounds(0,0,width, height); //???
//    canvas->SetSize(width, height); //???
//    testFrame->SetBounds(0,0,width, height); //???
//    testFrame->SetSize(width, height); //???
}

int main()
{
...
   canvas = new Gwk::Controls::Canvas(skin);
...
    testFrame = new TestFrame(canvas);
    GworkInput.Initialize(canvas);
    glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
...
}

I use this GLFW callback in my other GUI applications (nanoGUI) and it works nicely.

Anything to trigger a controls/canvas layout action?

Trying to build on Mingw64 - ptarget not found

Hi, I am trying to compile GWork under MinGW-64. I've been getting various errors and had to do the following changes to fix them. Now I'm stuck at error: 'ptarget' was not declared in this scope in WindowsPlatform.cpp:325. Any suggestions? Thanks!

Index: source/platform/CMakeLists.txt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- source/platform/CMakeLists.txt	(revision 961d2322cca41731cdff3d49c51842fd34392eaf)
+++ source/platform/CMakeLists.txt	(revision )
@@ -1,6 +1,7 @@
 # Gwork platform
 
 include_directories(
+    ${GWK_SOURCE_DIR}/source/gwork/include
     ${GWK_SOURCE_DIR}/source/platform/include
     ${GWK_RENDER_INCLUDES}
 )
Index: source/platform/platforms/WindowsPlatform.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- source/platform/platforms/WindowsPlatform.cpp	(revision 961d2322cca41731cdff3d49c51842fd34392eaf)
+++ source/platform/platforms/WindowsPlatform.cpp	(revision )
@@ -15,7 +15,7 @@
 #endif
 #endif
 
-#include <Gwork/Macros.h>
+//#include <Gwork/Macros.h>
 #include <Gwork/Utility.h>
 #include <Gwork/Platform.h>
 #include <Gwork/Input/Windows.h>
@@ -152,7 +152,7 @@
     {
         memset(FilterBuffer, 0, sizeof(FilterBuffer));
         memcpy(FilterBuffer, Extension.c_str(),
-               Gwk::Min(Extension.length(), sizeof(FilterBuffer)));
+               std::min(Extension.length(), sizeof(FilterBuffer)));
 
         for (int i = 0; i < FILTERBUFFER_SIZE; i++)
         {
@@ -183,7 +183,6 @@
 
     if (GetOpenFileNameA(&opf))
     {
-        if (handler && fnCallback)
         {
             filePathOut = opf.lpstrFile;
         }
@@ -227,7 +226,6 @@
             if (psi->GetDisplayName(SIGDN_DESKTOPABSOLUTEPARSING, &strOut) != S_OK)
                 return bSuccess;
 
-            if (handler && fnCallback)
             {
                 filePathOut = Utility::Narrow(strOut); // set result
             }
@@ -243,7 +241,7 @@
 }
 
 bool Gwk::Platform::FileSave(const String& Name, const String& StartPath, const String& Extension,
-                             String& filePathOut);
+                             String& filePathOut)
 {
     char Filestring[FILESTRING_SIZE];
     String returnstring;
@@ -251,7 +249,7 @@
     {
         memset(FilterBuffer, 0, sizeof(FilterBuffer));
         memcpy(FilterBuffer, Extension.c_str(),
-               Gwk::Min(Extension.size(), sizeof(FilterBuffer)));
+               std::min(Extension.size(), sizeof(FilterBuffer)));
 
         for (int i = 0; i < FILTERBUFFER_SIZE; i++)
         {
@@ -282,7 +280,6 @@
 
     if (GetSaveFileNameA(&opf))
     {
-        if (handler && fnCallback)
         {
             filePathOut = opf.lpstrFile;
         }
Index: source/platform/renderers/OpenGL/OpenGL.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- source/platform/renderers/OpenGL/OpenGL.cpp	(revision 961d2322cca41731cdff3d49c51842fd34392eaf)
+++ source/platform/renderers/OpenGL/OpenGL.cpp	(revision )
@@ -20,6 +20,10 @@
 #define STB_TRUETYPE_IMPLEMENTATION
 #define STBTT_STATIC
 #include "stb_truetype.h"
+#ifdef _WIN32
+#include <windows.h>
+#include "Gwork/WindowProvider.h"
+#endif
 
 namespace Gwk
 {
Index: cmake/Config.cmake
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- cmake/Config.cmake	(revision 961d2322cca41731cdff3d49c51842fd34392eaf)
+++ cmake/Config.cmake	(revision )
@@ -19,7 +19,8 @@
     # TODO: option(RENDER_GDIPLUS   "Renderer: GDIPlus" OFF)
     
     # For Windows platform:
-    # set(GWK_PLATFORM_NAME "Windows")    
+    set(GWK_PLATFORM_NAME "Windows")
+    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -DGWK_PLATFORM_WINDOWS=1)
 endif()
 
 # Cross-platform

Few questions

Hi,

  1. I've created a custom tooltip control but I can't figure out how to make the corners rounded and how to add a border colour like the default tooltip. Right now I'm inheriting from Rectangle for my control. Do you know the best way to implement this so I can get rounded corners and a border?

  2. It would be nice to have a max length limit on the TextBox, I can submit a PR adding it. How I'm thinking about implementing it is adding SetMaxLength/GetMaxLength methods, and a check inside TextBox::InsertText. One corner case I can think of right now is when the inserted text will go past the limit I think what I will do is input the text up until the limit, the rest will be cut off. Does this sound alright? Is there anything else I'm missing?

  3. I'm using Allegro5 and the numpad enter key isn't currently considered an enter key by GWork. What I was thinking of doing is adding to the existing case:

case ALLEGRO_KEY_ENTER:
case ALLEGRO_KEY_PAD_ENTER:
    return Gwk::Key::Return;

Can't find SDL2 when generating project on Windows using cmake

I tried using cmake, but it gives the following error:

CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindPackageHandleS
tandardArgs.cmake:137 (message):
  Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.c
make:377 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindSDL2.cmake:169 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cmake/Config.cmake:121 (find_package)
  CMakeLists.txt:29 (include)

how to proceed?

Add resource abstraction

Each platform/build system set up handles resource paths in a different way. E.g. Windows has debug/release directories and resources looked for relative to current directory. OSX has bundles. Etc.

A client app/game might want a different approach, so get all resources via an abstration so this can be altered accordingly.

Also need to look at better error reporting. Terrible at the moment.

Fix Windows builds

I've been testing on Mac OSX. Cross platforms SDKs SFML2 and Allegro5 tested. Windows needs some work to refactor for the changes.

(edit) Note: This issue is specific to the Windows APIs, i.e. DirectX

Different usage of the facename font field

GWork's font abstraction builds on the idea that in order to use a font you just have to know the font's facename (e.g. Arial). However some renderers such as SFML (and SDL?) don't load fonts from the system and instead require a filename. GWork uses a workaround where it will just use the font field facename as filename. This seems to work just fine when you can ensure that you only operate with one specific renderer, but it gets more difficult for things like the GWork tests.

For example the Label API test fails to run with the SFML renderer because it only specifies OpenSans without file extension and thus SFML can't load the OpenSans.tff font.

SFML Error:

Failed to load font "OpenSans" (failed to create the font face)

Question is whether this should be refactored by maybe adding another field to the font struct to specify an actual font file or whether there's a more general approach to it, that I currently don't know of.

Integrate GWork into another project

Is there any prefered mechanism for integrating GWork into a project?

Merely setting it as a subproject using add_subdirectory(GWork) doesn't seem to work, but there is also no provided FindGWork.cmake to allow finding GWork externally.

Any help appreciated!

Unicode support

It might be better to just use wstrings in GWEN and make everything use Unicode. I can't really see the benefit of supporting both types in TextObject. The non-Unicode string in TextObject is ASCII (because of the conversion), not UTF8. I would prefer it all to be UTF8 but Windows doesn't support this well, only UTF16. So platforms which require UTF8 (like Allegro) may have to convert on the fly, or TextObject supports UTF8.

See notes on the wiki for more details.

Add C++ reflection API

This is currently being done with Ponder in the ponder branch.

The goal is to allow creation of controls using data or script more easily. If the Gwork API is exposed then we only need to do this once. This is also a good test for Ponder.

Code in header files

I have not done an exhaustive search, but I noticed there is code inside some of the header files.
The ones I saw were the 3 headers related to skins, Texturing, TextureBase, and Simple.
This isn't inherently a problem, but it causes undefined reference exceptions when I'm linking my program.

SDL2 clipping broken

There appears to be a bug in SDL2 which other people are seeing to do with rectangle clipping: https://bugzilla.libsdl.org/show_bug.cgi?id=2700

This affects Gwork badly so hardly anything gets drawn on screen in the tests. I have disabled clipping for SDL2 in master, but this will lead to other artefacts. Other platforms seems to be working fine.

Add platform and compiler defines

Current Gwork uses the default OS and compiler defines, e.g. _WIN32 etc. This can be problematic where you get setups that are a mix of these, e.g. MinG Win.

Add, in a platform header, OS, and compiler detection and defines and replace the current macros used.

Question about GWork object destruction order

I am currently trying to use GWork within a singleton class like the following:

    class GuiManager {
        public:
            // NOTE: allegro *must* be initialized for these to work
            static Gwk::Controls::Canvas* GetCanvas() {
                return GetInst().gwk_canvas;
            }

            static Gwk::Input::Allegro* GetInput() {
                return GetInst().gwk_input;
            }

        private:
            static GuiManager& GetInst() {
                static GuiManager gui_inst;
                return gui_inst;
            }

            GuiManager() {
                // this is why allegro must be initialized
                ALLEGRO_DISPLAY* display = al_get_current_display();

                Gwk::Platform::SetPlatformWindow(display);

                gwk_renderer = new Gwk::Renderer::Allegro();
                gwk_skin = new Gwk::Skin::TexturedBase(gwk_renderer);
                gwk_skin->SetRender(gwk_renderer);
                gwk_skin->Init("data/DefaultSkin.png");
                gwk_skin->SetDefaultFont("data/OpenSans.ttf", 11);

                gwk_canvas = new Gwk::Controls::Canvas(gwk_skin);
                gwk_canvas->SetSize(al_get_display_width(display),
                                    al_get_display_height(display));
                gwk_canvas->SetDrawBackground(true);
                gwk_canvas->SetBackgroundColor(Gwk::Color(94, 127, 181, 255));
                gwk_input = new Gwk::Input::Allegro();
                gwk_input->Initialize(gwk_canvas);
            }

            Gwk::Renderer::Allegro* gwk_renderer;
            Gwk::Skin::TexturedBase* gwk_skin;
            Gwk::Controls::Canvas* gwk_canvas;
            Gwk::Input::Allegro* gwk_input;
    };

This is causing an error on program termination:
*** Error in./client': corrupted double-linked list: 0x000000000139cd40 ***`

I believe this is caused by the non-deterministic deletion order when the singleton members are destructed.
Is there a correct order to follow for manual deletion of these GWork instances?
Currently if I try to delete them I am getting a segfault.

Thanks in advance.

Improve consistency

  • Boolean tests: Is<test>() (e.g. visible and hidden don't follow this)
  • Events callbacks use On<event>()

UserDataStorage

Currently every control contains one of these. This could be optimised out:

  • Perhaps pointer to dynamically allocated, on-demand store.
  • To central store with unique handle per control.

Header install problem

The current cmake scripts have some issues.
I. SFML renderer uses GL, but does not link to it.
II. include headers are installed incorrectly.

minor issues:
a) NULL renderer seems like pointless cruft. (its not even the default renderer)
b) inability to compile multiple renderer (relatively minor)

I've fixed issue I and made a PR
and will be fixing issue II shortly.

I feel the need to elaborate on Issue II. in source/platform/CMakeLists.txt the variable GWK_RENDER_HEADERS is set to all of the headers inside source/platform/include, save the inactive renderers.
Then, those headers are installed in two locations, making two copies.

install(FILES ${GWK_RENDER_HEADERS}
        DESTINATION include/Gwork/Input)

install(FILES ${GWK_RENDER_HEADERS}
        DESTINATION include/Gwork/Renderers)

The end result is that source/platform/include/Gwork/BaseRender.h gets installed in include/Gwork/Render/BaseRender.h and include/Gwork/Input/BaseRender.h, but not include/Gwork/BaseRender.h

Blank Renderer

Please consider adding a 'blank' renderer for users to begin work on creating their own custom renderers.
Thank you for your time and hard work!

CMake build scripts

Use Cmake instead of Premake. Premake is very nice in theory, or if you are only supporting Windows, but for other targets, like iOS it still doesn't have official code generation.

MinGW linker errors when building the SFML example on Windows

I'm running into linker errors when building the SFML example on Windows with MinGW. To me it seems like the platform sources isn't being linked properly and/or exported wrongly.

Here's the verbose output:

[ 99%] Linking CXX executable ..\..\..\bin\GworkSFML2Sample.exe
cd /d GWork\build\source\samples && cmake.exe -E cmake_link_script CMakeFiles\GworkSFML2Sample.dir\link.txt --verbose=1
cmake.exe -E remove -f CMakeFiles\GworkSFML2Sample.dir/objects.a
C:\Dev\MinGW64-PosixSEH610r0\bin\ar.exe cr CMakeFiles\GworkSFML2Sample.dir/objects.a @CMakeFiles\GworkSFML2Sample.dir\objects1.rsp
C:\Dev\MinGW64-PosixSEH610r0\bin\g++.exe  -g   -Wl,--whole-archive CMakeFiles\GworkSFML2Sample.dir/objects.a -Wl,--no-whole-archive  -o ..\..\..\bin\GworkSFML2Sample.exe -Wl,--out-implib,..\..\..\lib\libGworkSFML2Sample.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\GworkSFML2Sample.dir\linklibs.rsp
libGwork.a(Anim.cpp.obj): In function `Gwk::Anim::TimedAnimation::TimedAnimation(float, float, float)':
GWork/source/gwork/source/Anim.cpp:105: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
libGwork.a(Anim.cpp.obj): In function `Gwk::Anim::TimedAnimation::Think()':
GWork/source/gwork/source/Anim.cpp:126: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
libGwork.a(DragAndDrop.cpp.obj): In function `Gwk::UpdateHoveredControl(Gwk::Controls::Base*, int, int)':
GWork/source/gwork/source/DragAndDrop.cpp:190: undefined reference to `Gwk::Platform::SetCursor(unsigned char)'
libGwork.a(DragAndDrop.cpp.obj): In function `Gwk::DragAndDrop::OnMouseMoved(Gwk::Controls::Base*, int, int)':
GWork/source/gwork/source/DragAndDrop.cpp:229: undefined reference to `Gwk::Platform::SetCursor(unsigned char)'
libGwork.a(InputHandler.cpp.obj): In function `Gwk::Input::OnCanvasThink(Gwk::Controls::Base*)':
GWork/source/gwork/source/InputHandler.cpp:137: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
GWork/source/gwork/source/InputHandler.cpp:150: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
libGwork.a(InputHandler.cpp.obj): In function `Gwk::Input::OnMouseClicked(Gwk::Controls::Base*, int, bool)':
GWork/source/gwork/source/InputHandler.cpp:215: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
GWork/source/gwork/source/InputHandler.cpp:222: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
libGwork.a(InputHandler.cpp.obj): In function `Gwk::Input::OnKeyEvent(Gwk::Controls::Base*, int, bool)':
GWork/source/gwork/source/InputHandler.cpp:370: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
libGwork.a(Base.cpp.obj): In function `Gwk::Controls::Base::UpdateCursor()':
GWork/source/gwork/source/Controls/Base.cpp:956: undefined reference to `Gwk::Platform::SetCursor(unsigned char)'
libGworkTest.a(Test.cpp.obj): In function `TestFrame::Render(Gwk::Skin::Base*)':
GWork/source/test/source/Test.cpp:33: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
GWork/source/test/source/Test.cpp:36: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
libGwork.a(ProgressBar.cpp.obj): In function `ProgressBarThink::Think()':
GWork/source/gwork/source/Controls/ProgressBar.cpp:27: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
GWork/source/gwork/source/Controls/ProgressBar.cpp:29: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
libGwork.a(TextBox.cpp.obj): In function `Gwk::Controls::TextBox::UpdateCaretColor()':
GWork/source/gwork/source/Controls/TextBox.cpp:94: undefined reference to `Gwk::Platform::GetTimeInSeconds()'
libGwork.a(TextBox.cpp.obj):GWork/source/gwork/source/Controls/TextBox.cpp:99: more undefined references to `Gwk::Platform::GetTimeInSeconds()' follow
libGwork.a(TextBox.cpp.obj): In function `Gwk::Controls::TextBox::OnPaste(Gwk::Controls::Base*)':
GWork/source/gwork/source/Controls/TextBox.cpp:154: undefined reference to `Gwk::Platform::GetClipboardText[abi:cxx11]()'
libGwork.a(TextBox.cpp.obj): In function `Gwk::Controls::TextBox::OnCopy(Gwk::Controls::Base*)':
GWork/source/gwork/source/Controls/TextBox.cpp:162: undefined reference to `Gwk::Platform::SetClipboardText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
libGwork.a(TextBox.cpp.obj): In function `Gwk::Controls::TextBox::OnCut(Gwk::Controls::Base*)':
GWork/source/gwork/source/Controls/TextBox.cpp:170: undefined reference to `Gwk::Platform::SetClipboardText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

Here's the content of linklib.rsp file which contain all the libs that are being linked.

 ../../../lib/libGwork.a ../../../lib/libGworkSFML2.a D:/Programming/C++/Contrib/SFML/install/lib/libsfml-system-d.a D:/Programming/C++/Contrib/SFML/install/lib/libsfml-window-d.a D:/Programming/C++/Contrib/SFML/install/lib/libsfml-window.a D:/Programming/C++/Contrib/SFML/install/lib/libsfml-graphics-d.a D:/Programming/C++/Contrib/SFML/install/lib/libsfml-graphics.a D:/Programming/C++/Contrib/SFML/install/lib/libfreetype.a D:/Programming/C++/Contrib/SFML/install/lib/libjpeg.a -lopengl32 -lwinmm -lgdi32 ../../../lib/libGworkTest.a ../../../lib/libGworkSFML2.a ../../../lib/libGwork.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 

As you may notice, that libGworkSFML2 is being linked. Strangely enough they are linked twice though. But since it was linked I don't fully understand why the platform code isn't being found.

I'll try to play around with CMake a bit, but thought I report it and maybe you'd know something.

CMake fails on Win32 with GLFW

Hi,

I've been trying to build Gwork using CMake, for Win32 (Windows 7), Code::Blocks with MinGW 5.1.0, using OpenGL renderer with GLFW.
Unfortunately, CMake chokes when finding GLFW, both in command line and GUI mode. Of course, I manually provide the required directory paths (include and lib) for GLFW, but with no success. I attach its log, if of any help:
CMakeOutput.log.txt

Here is the CMake GUI reported problem:

Project version: 0.2.0
Including tests
Including sample
CMake Error at cmake/Modules/FindGLFW.cmake:233 (if):
if given arguments:

"OR" "OR"

Unknown arguments specified
Call Stack (most recent call first):
cmake/Config.cmake:105 (find_package)
CMakeLists.txt:29 (include)

Configuring incomplete, errors occurred!
See also "C:/Programming/GWork/build/CMakeFiles/CMakeOutput.log".

Anyway, I tried without any render target (using the Null one), and it succeeds in making the C::B project, but attempting to compile it fails immediately, with this:

-------------- Clean: all in gwork (compiler: GNU GCC Compiler)---------------

Cleaned "gwork - all"

-------------- Build: all in gwork (compiler: GNU GCC Compiler)---------------

Using makefile: Makefile
[ 1%] Building CXX object source/platform/CMakeFiles/GworkNull.dir/renderers/Null/Null.cpp.obj
[ 2%] Building CXX object source/platform/CMakeFiles/GworkNull.dir/platforms/NullPlatform.cpp.obj
[ 3%] Building CXX object source/platform/CMakeFiles/GworkNull.dir/platforms/PlatformCommon.cpp.obj
[ 4%] Building CXX object source/platform/CMakeFiles/GworkNull.dir/platforms/Utility.cpp.obj
C:\Programming\GWork\source\platform\platforms\Utility.cpp:26:22: fatal error: iconv.h: No such file or directory
compilation terminated.
mingw32-make.exe[2]: *** [source/platform/CMakeFiles/GworkNull.dir/platforms/Utility.cpp.obj] Error 1
mingw32-make.exe[1]: *** [source/platform/CMakeFiles/GworkNull.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2
source\platform\CMakeFiles\GworkNull.dir\build.make:137: recipe for target 'source/platform/CMakeFiles/GworkNull.dir/platforms/Utility.cpp.obj' failed
CMakeFiles\Makefile2:111: recipe for target 'source/platform/CMakeFiles/GworkNull.dir/all' failed
Makefile:126: recipe for target 'all' failed
Process terminated with status 2 (0 minute(s), 4 second(s))
4 error(s), 0 warning(s) (0 minute(s), 4 second(s))

Could anyone please help me a bit in this regard?

Many thanks.
Virgiliu

64 bit compilation

The MSVC version of GWEN turns off some warnings to avoid tonnes of messages, e.g. signed/unsigned, conversion from 64 bit to 32 bit. GWEN is essentially targeted at 32 bit. These warnings might not be able to be turned off using pragmas on other platforms, and if you don't like warnings, these are the only ones that appear in your project, where you have included GWEN: Fix.

Issue building on OS X

cmake

❯ cmake .. -G Ninja -DRENDER_SDL2=ON -DPONDER_INCLUDE_DIRS=~/study/c++/ponder/include -DPONDER_LIBRARIES=~/study/c++/ponder/build/libponder.dylib
Project version: 0.1.0
Including tests
Found Ponder version 1.0.2
Including sample
<FindSDL2.cmake>
</FindSDL2.cmake>
Using renderer SDL2
SDL2 includes: /usr/local/include/SDL2
SDL2 libs: /usr/local/lib/libSDL2main.a;/usr/local/lib/libSDL2.dylib;-framework Cocoa;/usr/local/lib/libSDL2_image.dylib;/usr/local/lib/libSDL2_ttf.dylib
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/me/study/c++/GWork/build

build

❯ ninja
[10/42] Building CXX object source/platform/CMakeFiles/GworkSDL2.dir/platforms/NullPlatform.cpp.o
FAILED: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++    -I../source/platform/include -I/usr/local/include/SDL2 -std=gnu++11 -MMD -MT source/platform/CMakeFiles/GworkSDL2.dir/platforms/NullPlatform.cpp.o -MF source/platform/CMakeFiles/GworkSDL2.dir/platforms/NullPlatform.cpp.o.d -o source/platform/CMakeFiles/GworkSDL2.dir/platforms/NullPlatform.cpp.o -c ../source/platform/platforms/NullPlatform.cpp
../source/platform/platforms/NullPlatform.cpp:15:7: error: no type named 'sleep' in the global namespace
    ::sleep(ms);
    ~~^
1 error generated.
[10/42] Building CXX object source/util/CMakeFiles/GworkUtil.dir/source/ImportExport/DesignerFormat.cpp.o
ninja: build stopped: subcommand failed.

97988f5 && billyquith/ponder@120c57e

OS 10.11.4

❯ uname -a
Darwin mpb15 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

❯ brew info sdl2
sdl2: stable 2.0.4 (bottled), HEAD
Low-level access to audio, keyboard, mouse, joystick, and graphics
https://www.libsdl.org/
/usr/local/Cellar/sdl2/2.0.4 (83 files, 3.9M) *
  Poured from bottle

❯ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ --version
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

❯ cmake --version
cmake version 3.5.2

Build fails with Allegro5 enabled

I have not tried to debug this further yet, but here is what I am getting when I first build the project:

Scanning dependencies of target Gwork
[  1%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Anim.cpp.o
[  2%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/BaseRender.cpp.o
[  3%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/ControlList.cpp.o
[  4%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/DragAndDrop.cpp.o
[  5%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Events.cpp.o
[  6%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Gwork.cpp.o
[  7%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Hook.cpp.o
[  8%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/InputHandler.cpp.o
[  9%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Skin.cpp.o
[ 10%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/ToolTip.cpp.o
[ 11%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Utility.cpp.o
[ 12%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Base.cpp.o
[ 13%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Button.cpp.o
[ 14%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Canvas.cpp.o
[ 15%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/CheckBox.cpp.o
[ 16%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/CollapsibleCategory.cpp.o
[ 17%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ColorControls.cpp.o
[ 18%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ColorPicker.cpp.o
[ 19%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ComboBox.cpp.o
[ 20%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/CrossSplitter.cpp.o
[ 21%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/DockBase.cpp.o
[ 22%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/DockedTabControl.cpp.o
[ 23%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Dragger.cpp.o
[ 24%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/GroupBox.cpp.o
[ 25%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/HSVColorPicker.cpp.o
[ 26%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/HorizontalScrollBar.cpp.o
[ 27%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/HorizontalSlider.cpp.o
[ 28%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ImagePanel.cpp.o
[ 29%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Label.cpp.o
[ 30%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/LabelClickable.cpp.o
[ 31%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ListBox.cpp.o
[ 32%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Menu.cpp.o
[ 33%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/MenuItem.cpp.o
[ 34%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/MenuStrip.cpp.o
[ 35%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/NumericUpDown.cpp.o
[ 36%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/PageControl.cpp.o
[ 37%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ProgressBar.cpp.o
[ 38%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Properties.cpp.o
[ 39%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/PropertyTree.cpp.o
[ 40%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/RadioButton.cpp.o
[ 41%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/RadioButtonController.cpp.o
[ 42%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Rectangle.cpp.o
[ 43%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ResizableControl.cpp.o
[ 44%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Resizer.cpp.o
[ 45%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/RichLabel.cpp.o
[ 46%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ScrollBar.cpp.o
[ 47%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ScrollBarBar.cpp.o
[ 48%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ScrollBarButton.cpp.o
[ 49%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/ScrollControl.cpp.o
[ 50%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Slider.cpp.o
[ 51%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/SplitterBar.cpp.o
[ 52%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/TabButton.cpp.o
[ 53%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/TabControl.cpp.o
[ 54%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/TabStrip.cpp.o
[ 55%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Text.cpp.o
[ 56%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/TextBox.cpp.o
[ 57%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/TextBoxNumeric.cpp.o
[ 58%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/TreeControl.cpp.o
[ 59%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/TreeNode.cpp.o
[ 60%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/VerticalScrollBar.cpp.o
[ 61%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/VerticalSlider.cpp.o
[ 62%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/WindowCanvas.cpp.o
[ 63%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/WindowControl.cpp.o
[ 64%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Dialog/FileOpen.cpp.o
[ 65%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Dialog/FileSave.cpp.o
[ 66%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Dialog/FolderOpen.cpp.o
[ 67%] Building CXX object source/gwork/CMakeFiles/Gwork.dir/source/Controls/Dialog/Query.cpp.o
[ 68%] Linking CXX static library ../../lib/libGwork.a
[ 68%] Built target Gwork
Scanning dependencies of target GworkAllegro5
[ 69%] Building CXX object source/platform/CMakeFiles/GworkAllegro5.dir/renderers/Allegro5/Allegro5.cpp.o
[ 70%] Building CXX object source/platform/CMakeFiles/GworkAllegro5.dir/platforms/Allegro5Platform.cpp.o
[ 71%] Linking CXX static library ../../lib/libGworkAllegro5.a
[ 71%] Built target GworkAllegro5
Scanning dependencies of target GworkTest
[ 72%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/Test.cpp.o
[ 73%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/Button.cpp.o
[ 74%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/Checkbox.cpp.o
[ 75%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/CollapsibleList.cpp.o
[ 76%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/ColorPicker.cpp.o
[ 77%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/ComboBox.cpp.o
[ 78%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/CrossSplitter.cpp.o
[ 79%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/GroupBox.cpp.o
[ 80%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/ImagePanel.cpp.o
[ 81%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/Label.cpp.o
[ 82%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/LabelMultiline.cpp.o
[ 83%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/ListBox.cpp.o
[ 84%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/MenuStrip.cpp.o
[ 85%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/Numeric.cpp.o
[ 86%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/PageControl.cpp.o
[ 87%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/ProgressBar.cpp.o
[ 88%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/Properties.cpp.o
[ 89%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/RadioButton.cpp.o
[ 90%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/ScrollControl.cpp.o
[ 91%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/Slider.cpp.o
[ 92%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/StatusBar.cpp.o
[ 93%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/TabControl.cpp.o
[ 94%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/TextBox.cpp.o
[ 95%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/TestAPI.cpp.o
[ 96%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/TreeControl.cpp.o
[ 97%] Building CXX object source/test/CMakeFiles/GworkTest.dir/source/api/Window.cpp.o
[ 98%] Linking CXX static library ../../lib/libGworkTest.a
[ 98%] Built target GworkTest
Scanning dependencies of target GworkAllegro5Sample
[ 99%] Building CXX object source/samples/CMakeFiles/GworkAllegro5Sample.dir/Allegro5/Allegro5Sample.cpp.o
In file included from /home/grant/projects/GWork/source/gwork/include/Gwork/Skins/TexturedBase.h:12:0,
                 from /home/grant/projects/GWork/source/samples/Allegro5/Allegro5Sample.cpp:8:
/home/grant/projects/GWork/source/gwork/include/Gwork/Skin.h:64:79: error: ‘Position’ has not been declared
             virtual void DrawTabButton(Controls::Base* control, bool bActive, Position dir) = 0;
                                                                               ^~~~~~~~
/home/grant/projects/GWork/source/gwork/include/Gwork/Skin.h:100:68: error: ‘Position’ has not been declared
             virtual void DrawScrollButton(Controls::Base* control, Position direction, bool bDepressed,
                                                                    ^~~~~~~~
In file included from /home/grant/projects/GWork/source/samples/Allegro5/Allegro5Sample.cpp:8:0:
/home/grant/projects/GWork/source/gwork/include/Gwork/Skins/TexturedBase.h:587:26: error: ‘virtual void Gwk::Skin::TexturedBase::DrawTabButton(Gwk::Controls::Base*, bool, Gwk::Position)’ marked ‘override’, but does not override
             virtual void DrawTabButton( Gwk::Controls::Base* control, bool bActive, Position dir ) override
                          ^~~~~~~~~~~~~
/home/grant/projects/GWork/source/gwork/include/Gwork/Skins/TexturedBase.h:822:26: error: ‘virtual void Gwk::Skin::TexturedBase::DrawScrollButton(Gwk::Controls::Base*, Gwk::Position, bool, bool, bool)’ marked ‘override’, but does not override
             virtual void DrawScrollButton( Gwk::Controls::Base* control, Position direction, bool bDepressed, bool bHovered, bool bDisabled ) override
                          ^~~~~~~~~~~~~~~~
/home/grant/projects/GWork/source/samples/Allegro5/Allegro5Sample.cpp: In function ‘int main(int, char**)’:
/home/grant/projects/GWork/source/samples/Allegro5/Allegro5Sample.cpp:51:29: error: cannot declare variable ‘skin’ to be of abstract type ‘Gwk::Skin::TexturedBase’
     Gwk::Skin::TexturedBase skin(renderer);
                             ^~~~
In file included from /home/grant/projects/GWork/source/samples/Allegro5/Allegro5Sample.cpp:8:0:
/home/grant/projects/GWork/source/gwork/include/Gwork/Skins/TexturedBase.h:21:15: note:   because the following virtual functions are pure within ‘Gwk::Skin::TexturedBase’:
         class TexturedBase : public Gwk::Skin::Base
               ^~~~~~~~~~~~
In file included from /home/grant/projects/GWork/source/gwork/include/Gwork/Skins/TexturedBase.h:12:0,
                 from /home/grant/projects/GWork/source/samples/Allegro5/Allegro5Sample.cpp:8:
/home/grant/projects/GWork/source/gwork/include/Gwork/Skin.h:64:26: note:   virtual void Gwk::Skin::Base::DrawTabButton(Gwk::Controls::Base*, bool, int)
             virtual void DrawTabButton(Controls::Base* control, bool bActive, Position dir) = 0;
                          ^~~~~~~~~~~~~
/home/grant/projects/GWork/source/gwork/include/Gwork/Skin.h:100:26: note:  virtual void Gwk::Skin::Base::DrawScrollButton(Gwk::Controls::Base*, int, bool, bool, bool)
             virtual void DrawScrollButton(Controls::Base* control, Position direction, bool bDepressed,
                          ^~~~~~~~~~~~~~~~
/home/grant/projects/GWork/source/samples/Allegro5/Allegro5Sample.cpp:68:5: error: ‘UnitTest’ was not declared in this scope
     UnitTest* unit = new UnitTest(canvas);
     ^~~~~~~~
/home/grant/projects/GWork/source/samples/Allegro5/Allegro5Sample.cpp:68:15: error: ‘unit’ was not declared in this scope
     UnitTest* unit = new UnitTest(canvas);
               ^~~~
/home/grant/projects/GWork/source/samples/Allegro5/Allegro5Sample.cpp:68:26: error: expected type-specifier before ‘UnitTest’
     UnitTest* unit = new UnitTest(canvas);
                          ^~~~~~~~
source/samples/CMakeFiles/GworkAllegro5Sample.dir/build.make:62: recipe for target 'source/samples/CMakeFiles/GworkAllegro5Sample.dir/Allegro5/Allegro5Sample.cpp.o' failed
make[2]: *** [source/samples/CMakeFiles/GworkAllegro5Sample.dir/Allegro5/Allegro5Sample.cpp.o] Error 1
CMakeFiles/Makefile2:280: recipe for target 'source/samples/CMakeFiles/GworkAllegro5Sample.dir/all' failed
make[1]: *** [source/samples/CMakeFiles/GworkAllegro5Sample.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

The library itself seems to build which is strange because there are errors being thrown from within the library. I will update this if I can find out more information.

Fix ResizableControl::DisableResizing

I could not get DisableResizing to work properly for the current checkout I have of the gwork-branch. Perhaps I was doing something wrong, I am just beginning to use the lib so I'm not entirely familiar with the ins and outs. My opengl-renderer also doesn't implement scissoring yet so that could possibly be the cause, but from how the issue appears I don't think so.

I wrote a patch to fix it. You can have a look at http://i.imgur.com/65sJ5fe.png to see the issue I was having, one column with WindowControl with resizing enabled, and another with it disabled. The rows shows how it looks pre- and post-patch.

Since I can't create a pull-request without having done all the repo-work on github, all I can offer is this diff of my changes: https://gitlab.com/jonas.lindgren/gwork/commit/3555e6000ca5152fb1df7df5dd065747a5f9c8a3.diff

The code snippet necessary to showcase the problem goes something like this:

Gwk::Controls::WindowControl* window = new Gwk::Controls::WindowControl(canvas);
window->SetTitle("Space survival - Start menu");
window->SetSize(300, 300);
window->SetPos(
1280/2 - window->GetSize().x/2,
720/2 - window->GetSize().y/2
);
window->SetDeleteOnClose(true);
window->DisableResizing();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.