| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi, I can see a problem that seems to be related to the amount of elements that are added to an oodialog. My application has almost 1000 ooDialog elements and I have the problem that the background color of the dialog is displayed also in the combobox elements when the combobox is opened. I have created a test application and if a specific amount of elements are added to the application itself, the color of the comboboxes seems to change. It seems that there is a limit of elements to be added to ooDialog, because if some more elements are added I receive a popup with the message: "Messages have exceeded the maximum number of allocated table entries. No message can be added" Sometimes I receive the Message: "Dialog Control elements have exceeded the maximum number of allocated color table entries. The Color for dialog ontrol cannot be added" Changing the max elements when self~CREATE() is performed to a higher value does not help. Thanks for any helping information .... Martin |
|
#2
| |||
| |||
| On Jul 7, 8:21*am, mberg <mb...@de.ibm.com> wrote: > Hi, > I can see a problem that seems to be related to the amount of elements > that are added to an oodialog. > My application has almost 1000 ooDialog elements and I have the > problem that the background color of the dialog is displayed also in > the combobox elements when the combobox is opened. > I have created a test application and if a specific amount of elements > are added to the application itself, the color of the comboboxes seems > to change. > It seems that there is a limit of elements to be added to ooDialog, Martin, that's right there are limits to the nunber of things you can add to 1 dialog. The information that is used to control each dialog is stored in tables. The size of the tables is fixed. > because if some more elements are added I receive a popup with the > message: > > "Messages have exceeded the maximum number of allocated table entries. > No message can be added" The message table has room for 500 entries. > Sometimes I receive the Message: > > "Dialog Control elements have exceeded the maximum number of allocated > color table entries. The Color for dialog ontrol cannot be added" The color table table has room for 1000 entries. You only need an entry for a dialog control where you change the color of the control from the default color. Most people leave dialog controls with their default color. > Changing the max elements when self~CREATE() is performed to a higher > value does not help. The max elements number you use in self~create() refers to the number of dialog controls, not to amount of information that is stored for a single dialog. Having one thousand controls in a single dialog is a huge number of controls. I think the best advice is try and design your application so it doesn't have so many controls in one dialog. I'll take a look at changing the number of table entries depending on the number of max elements when the dialog is created. Making it relative to the number of elements, rather than fixed. But, at some point you are going to have problems if you add too many controls to one dialog. For instance, each time the OS sends a message to a dialog, the message table has to be searched to see if that message is one of the ones in the message table. If the message table gets too big, your dialog will seem sluggish to your users. Especially to users on a slower computer. I don't know what the 'too' many number is on today's computers. -- Mark Miesfeld |
|
#3
| |||
| |||
| On Jul 8, 2:00 pm, Mark Miesfeld <miesf...@gmail.com> wrote: > On Jul 7, 8:21 am, mberg <mb...@de.ibm.com> wrote: > > > Hi, > > I can see a problem that seems to be related to the amount of elements > > that are added to an oodialog. > > My application has almost 1000 ooDialog elements and I have the > > problem that the background color of the dialog is displayed also in > > the combobox elements when the combobox is opened. > > I have created a test application and if a specific amount of elements > > are added to the application itself, the color of the comboboxes seems > > to change. > > It seems that there is a limit of elements to be added to ooDialog, > > Martin, that's right there are limits to the nunber of things you can > add to 1 dialog. The information that is used to control each dialog > is stored in tables. The size of the tables is fixed. > > > because if some more elements are added I receive a popup with the > > message: > > > "Messages have exceeded the maximum number of allocated table entries. > > No message can be added" > > The message table has room for 500 entries. > > > Sometimes I receive the Message: > > > "Dialog Control elements have exceeded the maximum number of allocated > > color table entries. The Color for dialog ontrol cannot be added" > > The color table table has room for 1000 entries. You only need an > entry for a dialog control where you change the color of the control > from the default color. Most people leave dialog controls with their > default color. > > > Changing the max elements when self~CREATE() is performed to a higher > > value does not help. > > The max elements number you use in self~create() refers to the number > of dialog controls, not to amount of information that is stored for a > single dialog. > > Having one thousand controls in a single dialog is a huge number of > controls. I think the best advice is try and design your application > so it doesn't have so many controls in one dialog. > > I'll take a look at changing the number of table entries depending on > the number of max elements when the dialog is created. Making it > relative to the number of elements, rather than fixed. > But, at some point you are going to have problems if you add too many > controls to one dialog. > > For instance, each time the OS sends a message to a dialog, the > message table has to be searched to see if that message is one of the > ones in the message table. If the message table gets too big, your > dialog will seem sluggish to your users. Especially to users on a > slower computer. I don't know what the 'too' many number is on > today's computers. > > -- > Mark Miesfeld |
|
#4
| |||
| |||
| On 8 Jul., 14:00, Mark Miesfeld <miesf...@gmail.com> wrote: Hi Mark, thanks for your answer. The problem is, that the application has a background color and so each text element that is added to the dialog needs to have the same background color otherwise a grey box appears around the text. To prevent this I add the background color of the dialog (sel~BackgroundColor() ) also to each text element and ofcourse to Groupboxes etc. To prevent this I would need to have an option to set the text transparent. I found aDialogControl~TransparentText(--dc--) but I was not able to use that. I tried this handle = self~getself() dc = self~GetWindowDC(handle) self~TransparentText(dc) self~AddText(... But already the handle self~getself() does not work, because I get 0. It seems that ~getself() cannot be used in method definedialog. Later in method Run I use the self~getself() and i get a return of 787986. What I need is an option set a textobject "transparent". Thanks for a hint... Martin |
|
#5
| |||
| |||
| On 8 Jul., 14:00, Mark Miesfeld <miesf...@gmail.com> wrote: Hi Mark, thanks for your answer. The problem is, that the application has a background color and so each text element that is added to the dialog needs to have the same background color otherwise a grey box appears around the text. To prevent this I add the background color of the dialog (sel~BackgroundColor() ) also to each text element and ofcourse to Groupboxes etc. To prevent this I would need to have an option to set the text transparent. I found aDialogControl~TransparentText(--dc--) but I was not able to use that. I tried this handle = self~getself() dc = self~GetWindowDC(handle) self~TransparentText(dc) self~AddText(... But already the handle self~getself() does not work, because I get 0. It seems that ~getself() cannot be used in method definedialog. Later in method Run I use the self~getself() and i get a return of 787986. What I need is an option set a textobject "transparent". Thanks for a hint... Martin |
|
#6
| |||
| |||
| On 8 Jul., 14:00, Mark Miesfeld <miesf...@gmail.com> wrote: Hi Mark, did some more testing and using this code I'm able to write transparent text. fontobj = Font_Object~GetFont() -- this is specific to my implementation to get the current font object object = self~GetStaticControl(Data.id) -- connect to the text to be drawn dc = object~GetDC() object~FontToDC(dc, fontobj) object~TransparentText(dc) object~WriteDirect(dc,1,1,textobj.1) object~FreeDC(dc) The above code instead of self~SetStaticText(Data.id,'TEXT TEXT') will display the text on the dialog transparent. ;-)) But when the next self~Update() method is called, or when I switch to any other window and come back to to the dialog window (ALT+TAB) the text disappeares..... ;-(( It seems that the text needs to be written again and again ? So to use the ~TransparentText method I would need to write a own additional method that is started whenever I call ~Update() and this routine needs to rewrite all text dialog objects ? Is that what happens within the ooDialog implementation, the elements are redrawn again and again ? ........ Martin |
|
#7
| |||
| |||
| On Jul 10, 1:35 am, mberg <mb...@de.ibm.com> wrote: > On 8 Jul., 14:00, Mark Miesfeld <miesf...@gmail.com> wrote: > did some more testing and using this code I'm able to write > transparent text. > > fontobj = Font_Object~GetFont() -- this is specific to > my implementation to get the current font object > object = self~GetStaticControl(Data.id) -- connect to the text > to be drawn > dc = object~GetDC() > object~FontToDC(dc, fontobj) > object~TransparentText(dc) > object~WriteDirect(dc,1,1,textobj.1) > object~FreeDC(dc) > ... > Is that what happens within the ooDialog implementation, the elements > are redrawn again and again ? Martin, The windows, dialogs, controls, etc., are drawn by the OS. Any time a window is covered and then uncovered it needs to be redrawn by the OS. This doesn't have anything to do with ooDialog, it is just the way things work. What is happening with your code above is that you are getting a new device context, writing your text with that, and then freeing the device context. The next time the OS asks the control to draw itself, the control uses its own internal device context to redraw itself. What you are doing is clever, but I don't think it will end up being a good solution in the long run for you. For the next release of ooRexx (which is still a ways off) I'll change the ooDialog code so that the size of the various tables, like the color table, can vary depending on the number of elements specified in the create() method. That will solve the problem for you. I think I'll also add some methods so that you can directly set the max size of the tables. In the meantime, I'll look through the ooDialog code and see if there might be some temporary work around that you can use. If not, the only thing you can do is somehow reduce the number of elements in your dialog. -- Mark Miesfeld |
|
#8
| |||
| |||
| On Jul 9, 8:07 am, mberg <mb...@de.ibm.com> wrote: > I tried this > handle = self~getself() > dc = self~GetWindowDC(handle) > self~TransparentText(dc) > self~AddText(... > But already the handle self~getself() does not work, because I get 0. > It seems that ~getself() cannot be used in method definedialog. Just as a FYI. The handle is the window handle of the underlying operating system window. There is no handle until the dialog window has actually been created by the OS. In defineDialog(), the underlying dialog does not yet exist. -- Mark Miesfeld |
|
#9
| |||
| |||
| On 10 Jul., 16:03, Mark Miesfeld <miesf...@gmail.com> wrote: Hi Mark, what about an additional option "TRANSPARENT" for the self~ADDTEXT(....) >>-aUserDialog~AddText(--x--,--y--,--+----+--,--+----+--,--text--> +-cx-+ +-cy-+ >--+----------------------------------------+--)---------------->< +-,--+----------------------+--+-------+-+ | .---------------. | +-,--id-+ | V | | +-"----+-HIDDEN----+-+--"-+ +-SIMPLE------+ +-RIGHT-------+ +-CENTER------+ +-BORDER------+ +-TRANSPARENT-+ .... martin |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.