Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
232 user(s) are online (139 user(s) are browsing Forums)

Members: 0
Guests: 232

more...

Headlines

 
  Register To Post  

A very sophisticated MUI problem.
Just popping in
Just popping in


See User information
Hi there Amigans.
Last year I finally could learn C/C++, and being a MUI fan dived right into MUI coding.

Then I thought to start coding something I’ve always needed would be a good way to learn MUI faster… and would be fun too.

So I’ve started my project…
In this humble project of mine, I needed a TextEditor gadget (later it turned out that I actually needed 2 of them – one for edit and one for display).
I like the TextEditor.mcc functionalities… so decided to use it (no problems yet).

As I progressed, I realized that the TextEditor_WrapMode_NoWrap, is not fully implemented yet (no horizontal scrolling).

Ok, no worries. I could wait for the developers to implement it (the reasonable idea).
Or I could hack its source code and implement it myself (not a good idea).
Or… maybe I can write a dirty workaround for it using a ScrollGroup…

If I could put the text editor inside a ScrollGroup (actually into its VirtualGroup), and resize the TextEditor gadget everytime the text inside exceeds the gadget width, the effect would be just the thing needed.
And if the developers would implement the functionality in the future, I would just get rid of the ScrollGroup and use the built in scroller.

Then I wrote a quick centralized prototype to see if the idea works. It did. This is the result:
Resized Image

It worked like a charm.

So I decided to encapsulate all my dirty functions and variables into a subclassed version (which is the recommended way of MUI coding).

So I did it. But something very awkward has occurred. This is the result:
Resized Image


This is the code I resize the TextEditor and make the scroller visible:
if (result width)
    {   
DoMethod(data->obj_table.virt_groupMUIM_Group_InitChange);
        
set(data->obj_table.text_editorMUIA_FixWidthresult);
        
DoMethod(data->obj_table.virt_groupMUIM_Group_ExitChange);
        
set(data->obj_table.horiz_scrollerMUIA_ShowMeTRUE);
        
was_bigger TRUE;
        
make_cursor_visible(clobj);
    }
    else if(
was_bigger)
    {   
DoMethod(data->obj_table.virt_groupMUIM_Group_InitChange);
        
set(data->obj_table.text_editorMUIA_FixWidthwidth);
        
DoMethod(data->obj_table.virt_groupMUIM_Group_ExitChange);
        
set(data->obj_table.horiz_scrollerMUIA_ShowMeFALSE);
        
was_bigger FALSE;
    }

Setting MUIA_ShowMe when in a centralized function call works...
But when it is in a subclass, it messes up like this.
Any ideas?

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project