Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Feature parity for win32 version - Page 4 — Gideros Forum

Feature parity for win32 version

12467

Comments

  • hgy29 said:

    And also, as a self note, there is the issue with exporting the app icon, like with QT.

    so this also does not work on qt, right? is there a github issue for that, or should i add one?
  • hgy29hgy29 Maintainer
    yes, right, this is the exact same issue for both: having gideros studio generate windows icons (.ico files) and patching the exe file with the new icons
  • hgy29 said:

    yes, right, this is the exact same issue for both: having gideros studio generate windows icons (.ico files) and patching the exe file with the new icons

    on github at least: https://github.com/gideros/gideros/issues/359
  • in the test version you've sent when i open the new screen it sets itself to full-screen even though it is set up with s:setSize(800,480).
    (at first it was ok but on second run it was like this)

    also when closing the screen window with the 'x' the app did not recognize it being closed (only understood as being resized to some strange shape) and then reopening the window i could not see it, probably it was off-screen or something.

    you can try these with the code i've sent and you will see.

    and indeed tablet pressure does not work and tablet button is recognized as a simple left-click.
  • Sorry guys I am late, thanks for all the work. Now that you said it can we have win32 mingw64? :p
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • i guess media plugin is not so important on desktop, at least in the last few years i could do whatever i want using other methods (assuming the camera plugin works, does that work on win32?)
  • hgy29hgy29 Maintainer
    Unfortunately no, camera (and media in general) are generally complex apis
  • hgy29 said:

    Unfortunately no, camera (and media in general) are generally complex apis

    i see, one would think that they give easy access to these on desktops.

    let's see about the wacom stuff, that's more important.
  • MoKaLuxMoKaLux Member
    edited February 2023
    ok I built from latest Gideros GH source with win32 export (wiki is up to date :) ). Unfortunatelly for me some discrepencies happen :'(

    Some feedback:
    - Let me post YT videos to demonstrate the issues. Possible cause win32 file dialog not modal? (please see next post).

    when I open a file (an obj file) I have coded it so the obj (Sprite) is centered: Qt works as expected while win32 has weird random positions. In win32 it seems the top right coordinates of the windows dialog are propagated and set to the sprite coordinates?!

    Qt: the sprite doesn't move when opening files, expected behavior OK. win32 the sprites seems to follow the dialog box :/ , NOT OK.

    - the zoom to image with mouse wheel is fixed :)
    - the ALT button not working well is fixed :)

    I need to test the other fixesDONE, we are getting there folks :)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    edited February 2023
    following update:
    - win32 windows dialog box not modal <=> code not executed when it should

    Well I think this is the root cause of my troubles :)

    As a side effect when we click multiple times on the open file button it creates many windows dialog instead of one.


    The code I used:
    local mysprite = Sprite.new()
    mysprite:setPosition(128, 128)
    local pixel02 = Pixel.new(0x00ff00, 0.5, 64, 64)
    pixel02:setPosition(32, 32)
    local pixel03 = Pixel.new(0x0000ff, 0.75, 64, 64)
    stage:addChild(mysprite)
     
    -- *** BTNTXT ***
    function BTNTXT(xposx, xposy, xwidth, xheight, xtext, xttf, xparent, xcatcher)
    	local btn = ButtonTextP9UDDT.new({
    		isautoscale=false,
    		width=xwidth, height=xheight,
    		pixelcolorup=0x7d0633, pixelcolordown=0x7ddd33, pixelalpha=0.5,
    		text=xtext, ttf=xttf or gcf, textalpha=0.9,
    		textcolorup=gtextcolor1, textcolordown=gtextcolor1outline,
    		catcherx=xcatcher or 128,
    	})
    	btn:setPosition(xposx, xposy)
    	xparent:addChild(btn)
    	return btn
    end
     
    local btn01 = BTNTXT(128, 128*2, 64, 32, "ADD PIXEL", nil, stage, 36)
    stage:addChild(btn01)
    btn01:addEventListener("clicked", function(e)
    	print(mysprite:getNumChildren())
    	mysprite:addChild(pixel02)
    end)
     
    local btn02 = BTNTXT(128*2, 128*2, 64, 32, "OPEN FILE", nil, stage, 36)
    stage:addChild(btn02)
    btn02:addEventListener("clicked", function(e)
    	mysprite:addChild(pixel03) -- !!!this code is not executed right in win32!!!
    	local path = application:get("openFileDialog", "Choose", initpath, "All (*.*)") -- title, path, extensions
    	if path ~= nil then pixel03:setPosition(164, 164) -- !!!but it is executed here instead!!!
    	else pixel03:setPosition(164, 100) -- !!!and here!!!
    	end
    end)
    Hope this can help and I am having a look at this :)

    my first failed attemp :/ https://wiki.gideros.rocks/index.php/CPlusPlus_for_Gideros_Studio_Help#modal_windows_dialog

    I think I need to replace NULL by the gideros hwnd (hwndcopy)? but that didn't work (I also tried hInstcopy after declaring it), msys tells me that I need a LPUNKNOWN.
                            hr = CoCreateInstance(CLSID_FileSaveDialog, NULL, CLSCTX_ALL,
                                    IID_IFileSaveDialog, reinterpret_cast(&pFile));
    //                        hr = CoCreateInstance(CLSID_FileSaveDialog, hwndcopy, CLSCTX_ALL,
    //                                IID_IFileSaveDialog, reinterpret_cast(&pFile));
    G_API void setWin32Stuff(HINSTANCE hInst, HWND hwnd)
    {
      hInstcopy=hInst;
      hwndcopy=hwnd;
    }
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    Sorry @MoKaLux, I can't try your code because it miss ButtonTextP9UDDT class definition. I will try to mimic it.
  • MoKaLuxMoKaLux Member
    edited February 2023
    here it is, save .txt as .lua :) @hgy29
    txt
    txt
    buttons.txt
    7K
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    I think I understand now, but actually the issue problem is that while the file dialog is shown, gideros app is frozen, obviously because the Show() call of the file dialog doesn't return. Note that mysprite:addChild(pixel03) IS executed, but gideros can't render the change because it has to wait for your code to end its execution, which is stuck in Show() call
  • MoKaLuxMoKaLux Member
    edited February 2023
    yes I noticed the delayed execution but I didn't know this was a rendering issue :s
    as far as I understand while the dialog is shown it is entering a loop and waits for a response.

    Note that in Qt the windows dialogs are fully modal.
    I hope this will be the solution to my issues but I haven't found a fix myself yet :* I thought that may be an opengl issue but didn't dare to look into it >:)

    Note2: the issue in my app seems to be the mouse being captured through the dialog thus changing the sprite position. As a hack I tried to put another sprite between the dialog box and the app to stop the mouse propagation but as you said the code (app) is frozen and that didn't work. I will have to find something else :) with Gideros there is always a solution o:)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    I did more comparison with QT, and indeed QT allows some events to be processed in parallel with current processing during the call to openFileDialog(). This is bug in QT player, which could cause various issues. So in the end, win32 has correct behavior, not QT.
  • hgy29hgy29 Maintainer
    MoKaLux said:


    Note that in Qt the windows dialogs are fully modal.

    Actually no, there is a glitch while the window is being opened on QT, which allows some timer events to slip through, which is why gideros gets a chance to render latest changes, but this is extremely dangerous as it breaks single thread assumption.

    If you do want to render something on screen before showing your dialog, you should have delayed the dialog by one frame, which Timer.delayedCall or Core.asyncCall.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Member
    edited February 2023
    cool I will try this, thank you captain o:)

    PS: please note that when I say Qt is modal I mean you cannot select the running app unless the dialog is closed
    EDIT: well dialogs are actually modal, I messed up, sorry :(
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29 said:

    If you do want to render something on screen before showing your dialog, you should have delayed the dialog by one frame, which Timer.delayedCall or Core.asyncCall.

    SUPER GOOD NEWS, THAT WORKED (unless they drag the dialog box around) o:) YOU ARE AWESOME AT HELPING US OUT HGY29, THANKS A MILLION ;)

    I used Core.asyncCall and have better results with this:
    --	self.tiled_ui.btnBrowse:addEventListener("clicked", self.browse, self)
    	self.tiled_ui.btnBrowse:addEventListener("clicked", function()
    --		self:browse()
    		Core.asyncCall(TheStage.browse, self)
    	end)
    Viva Gideros, Viva HGY29 <3
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    @keszegh, I got the tablet stylus so had a try, and the mouse_hover event is being generated when I over the pen above my wacom tablet. Is there any setup I missed to make the bug appear, or maybe I misunderstood ?
  • I don't want to speak for keszegh but hgy29 I think he had a problem with tooltip not displaying when hovering over buttons (cf the Qt 5.x bug which was supposed to be fixed in Qt 6.x).
    Also I think he is using imgui.
    keszegh correct me if I am wrong (just trying to help ;) )
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • keszeghkeszegh Member
    edited February 2023
    yes, @hgy29 please try the project i've sent, when hovering over most menu elements in the imgui gui there should be a popup after a few seconds. try it with mouse, and if it shows, it should also be shown with hovering with a pen. for me it is not.

    but overall it is suspicious, as for me i think i did not see mouse_hover event being received. tomorrow i can test a bit more if there is anything to test.

    (in the top menu of my app there is an option to turn on/off these tooltips, but it should be on by default, but i mention this just in case)
  • hgy29hgy29 Maintainer
    Well, tried with your project and I do see the tooltips when hovering the pen

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29 said:

    Well, tried with your project and I do see the tooltips when hovering the pen

    i will double-check this later.
  • hgy29hgy29 Maintainer
    @keszegh, I have added touch/tablet support to win32, can you check if that works ok for you ? I have updated the template, use the link I sent you yesterday.
  • hgy29 said:

    @keszegh, I have added touch/tablet support to win32, can you check if that works ok for you ? I have updated the template, use the link I sent you yesterday.

    i will

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Member
    edited February 2023
    About 32bit/64bit, it could as well be compiled with mingw64 in the future.
    I will give this one a shot, see what I can find/test/learn :)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • @hgy29 , for me in qt hovering does not work. i wonder why. what is your wacom model? i use win10 and i have a relatively new type of model (intuos pro) but i think hovering did not work neither with my much older wacom.

    in win32 with new template i don't see pressure sensitivity (in my app in the top menu there is a 'pressure sensitivity' option, you can turn it on and see whether the drawing width depends on the pressure or not for you.

    so all negative test results so far.
  • more precisely, if i hover over a button in qt with pen then nothing happens. but if i press the button (with pen putting down) then afterwards there is a hover event actually (and so the tooltip appears).
  • MoKaLuxMoKaLux Member
    edited February 2023
    I have a problem with gideros documents path (docsPath).
    Short story:
    My problem is my app name starts with a number 3DPixel and in the appdata folder the name of my app becomes _DPixel:
    C:\Users\xxx\AppData\Roaming\_DPixel

    Long story:
    Gideros takes the application name PATH_AppName and creates the appdata folder for it:
    https://github.com/gideros/gideros/blob/fa9216b821dbf1c88b81f65c5cd03c6edcb946c0/win32_example/applicationmanager.cpp#L447?
    std::string docsPath=us(_wgetenv(L"APPDATA"));
    docsPath=docsPath+"\\"+PATH_AppName+"\\";
    CreateDirectory(ws(docsPath.c_str()).c_str(),NULL); // create dir if it does not exist
    gpath_setDrivePath(1,docsPath.c_str());
    gpath_setDrivePath(2,(PATH_Cache+"\\").c_str());
    My problem is my app name starts with a number 3DPixel and in the appdata folder the name of my app becomes _DPixel:
    C:\Users\xxx\AppData\Roaming\_DPixel

    I tried to trace back PATH_AppName to see where it gets modified and I got to this:
    static const char szAppName[256] = "WindowsDesktopTemplate" ;
    So I believe this must be done somewhere in some scripts files and I found it in \gdrexport\ExportBuiltin.cpp:
        else if(ctx->deviceFamily == e_Win32){
        	ctx->replaceList[0] << qMakePair(bytepad(ctx->templatenamews.toLatin1(),256), bytepad(ctx->basews.toLatin1(),256));
        	ctx->replaceList[0] << qMakePair(bytepad(QString("Win32 Template App Name").toUtf8(),256), bytepad(ctx->appName.toUtf8(),256));
        }
    So this is where it gets transformed? now the question is does it allow to have apps name that start with a number?

    Do you think this could be fixed? ;)

    Thank you o:)

    For ref:
    static QByteArray bytepad(QByteArray s,qsizetype sz) {
        QByteArray padded=QByteArray(s);
        padded.append(sz-s.size(),(char)0);
        return padded;
    }
    \gdrexport\ExportBuiltin.cpp:
        case e_Win32:
          templatedir = "win32";
          ctx->templatename = "WindowsDesktopTemplate";
          ctx->templatenamews = "WindowsDesktopTemplate";
          ctx->platform = "Win32";
          underscore = true;
          break;
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
Sign In or Register to comment.