Page 1 of 1

Position of get

Posted: Tue Jul 16, 2013 4:41 am
by c-tec
Hello Roger,
I have a complex dialog that is created from a database. With dcread gui fit the dialog size is calculated automatically. Now I have the problem that one element causes the dialog to get larger than expected. But I do not find the getelement in the getlist that is wrong positioned, it is not visible in the dialog. I have tried to check the getlist, but fund no element with my function that is out of the expected dialog size. Can you give me a tip for my testfunction to find the element the is more left then the defined screensize ?
regards
Rudolf

Code: Select all

function checkgetlist(aGetlist,aStaticSize) // size = {960,720}
******************************************************************
local x,cID,nZeile,nSpalte,nUnten,nLinks,nBreite,nHoehe
for x := 1 to len(aGetlist)
     cID     := aGetlist[x,cGETLIST_ID]
     nZeile  := aGetlist[x,nGETLIST_STARTROW]
     nSpalte := aGetlist[x,nGETLIST_STARTCOL]
     nUnten  := aGetlist[x,nGETLIST_ENDROW]
     nLinks  := aGetlist[x,nGETLIST_ENDCOL]
     nBreite := aGetlist[x,nGETLIST_WIDTH]
     nHoehe  := aGetlist[x,nGETLIST_HEIGHT]
     if !empty(nSpalte)
          if nSpalte > aStaticSize[1]
               altd()
          endif
          if !empty(nWidth)
               if nSpalte + nWidth > aStaticSize[1]
                    altd()
               endif
          endif
     endif
     if !empty(nWidth)
          if nWidth > aStaticSize[1]
               altd()
          endif
     endif
next x
toastmsg("Ready!")
return .t.

Re: Position of get

Posted: Tue Jul 16, 2013 8:50 am
by skiman
Hi,

I don't know if this is your exact code of the testfunction?

If so, you use nWidth instead of nBreite?

Re: Position of get

Posted: Tue Jul 16, 2013 11:00 pm
by c-tec
Hello,
you are right, I have extracted the part and forgetten to rename this var. For now I calculate the size in my code and set the window size in getoptions. But would be interesting for me to find the get element that is placed outside, because the dialogs are datadriven and I could make a warning message for such gets.
regards
Rudolf

Re: Position of get

Posted: Wed Jul 17, 2013 3:12 am
by reganc
Are you sure that it is one of the get elements that is making the dialog too big?

If the title of the dialog is long, that can have an effect as FIT also takes into account the title text length (and it's not really that good at doing that either).

Re: Position of get

Posted: Fri Jul 19, 2013 1:24 am
by c-tec
Hello,
I dont think that the title effects the size of the dialog, it is truncated and filled with ... at the end.
regards
Rudolf

Re: Position of get

Posted: Mon Jul 22, 2013 3:50 pm
by rdonnay
You should get used to using the eXpress++ object tree browser to view all the objects in a tree-view.

DCREAD GUI .. EVAL {|o|(wtf o)}

Double-click the DC_Dialog1 that appears in the debug window.

Re: Position of get

Posted: Sat Jul 27, 2013 11:33 pm
by c-tec
Hello Roger,
it is complicated to check a getlist with about 500 elements to check which one is out of range. So I hoped that it is possible like in my function.
regards
Rudolf

Re: Position of get

Posted: Mon Aug 05, 2013 9:10 am
by rdonnay
it is complicated to check a getlist with about 500 elements to check which one is out of range. So I hoped that it is possible like in my function.
You may need to write a special program that walks thru the getlist and then reports anything that may look like an anomoly:

Code: Select all

FOR i := 1 TO Len(GetList)

  oXbp := aGetList[i,oGETLIST_OBJECT]

  IF oXbp:currentPos()[1] > 500 .OR. oXbp:currentPos()[2] > 500 .OR. ;
     oXbp:currentSize()[1] > 1000 .OR. oXbp:currentSize()[2] > 1000

     WTF aGetList[i]

  ENDIF

NEXT