Click here to Skip to main content
15,893,161 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I saw the end of a rainbow the other day Pin
Marc Clifton9-Mar-17 2:03
mvaMarc Clifton9-Mar-17 2:03 
GeneralRe: I saw the end of a rainbow the other day Pin
Johnny J.9-Mar-17 3:05
professionalJohnny J.9-Mar-17 3:05 
GeneralNow you are going to get it Pin
CDP18028-Mar-17 23:19
CDP18028-Mar-17 23:19 
GeneralRe: Now you are going to get it Pin
den2k888-Mar-17 23:31
professionalden2k888-Mar-17 23:31 
GeneralRe: Now you are going to get it Pin
CDP18029-Mar-17 0:19
CDP18029-Mar-17 0:19 
GeneralRe: Now you are going to get it Pin
Richard Deeming9-Mar-17 1:26
mveRichard Deeming9-Mar-17 1:26 
GeneralRe: Now you are going to get it Pin
Marc Clifton9-Mar-17 2:12
mvaMarc Clifton9-Mar-17 2:12 
GeneralRe: Now you are going to get it Pin
CDP18029-Mar-17 3:04
CDP18029-Mar-17 3:04 
Kindof similar to the octree of graphics objects in the 3D engine. Ok, that would cover the spatial order.

The real problem is a little more complex. My tree may be unbalanced in several other ways. Simply looking at which layer a control is in does not tell wether it's over or under another control.

It begins very simple: Every control has a collection with 0-n children, which may again have children. When drawn, the controls are drawn in the order they are put into their parent's collection. This way, if two children overlap, the later one always will appear above the earlier one. Also, children are clipped to their parent's bounds, so they have no relevance to possible overlapping issues of the parent.

Sounds ok? I will only have to bring a selected control to the front by moving it to the last position of the collection it is in and everything is well.

Not quite. The root and top levels of the tree are not rendered at all. They are workspaces, used as layout objects and links in the tree. The root workspace fills the entire screen and is opened when the UI is initialized. The program then can go on and nest as many subdivisions of this root workspace until it finally opens views inside those workspaces. To make it even more complicated, there are also separate window workspaces, which are not subdivisions of the main worspace, but also children of the control that opened them. They can be moved freely, like a form and are most likely to overlap, depending on where they are dragged and released.

Their position in the control tree would define the order in which they are drawn, but this order would be unchangable. I could not simply bring it to the front or push it to the back.

My best idea would be to keep those workspaces in a separate list instead of the tree. The hit test and the rendering method would both have to work with both structures then, but then the window workspaces would be treated as peers in a list and their vertical positions would be determined again by their position in the list.
The language is JavaScript. that of Mordor, which I will not utter here

This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.

"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."

If software development were a circus, we would all be the clowns.

GeneralRe: Now you are going to get it Pin
Marc Clifton9-Mar-17 3:57
mvaMarc Clifton9-Mar-17 3:57 
GeneralRe: Now you are going to get it Pin
CDP18029-Mar-17 4:42
CDP18029-Mar-17 4:42 
GeneralWSO CCC OTD 09-03-17 Pin
LabVIEWstuff8-Mar-17 22:49
LabVIEWstuff8-Mar-17 22:49 
GeneralRe: WSO CCC OTD 09-03-17 Pin
PeejayAdams8-Mar-17 23:10
PeejayAdams8-Mar-17 23:10 
GeneralRe: WSO CCC OTD 09-03-17 - WINNER!!! Pin
LabVIEWstuff8-Mar-17 23:13
LabVIEWstuff8-Mar-17 23:13 
GeneralRe: WSO CCC OTD 09-03-17 - WINNER!!! Pin
OriginalGriff8-Mar-17 23:23
mveOriginalGriff8-Mar-17 23:23 
GeneralRe: WSO CCC OTD 09-03-17 - WINNER!!! Pin
PeejayAdams8-Mar-17 23:50
PeejayAdams8-Mar-17 23:50 
GeneralRe: WSO CCC OTD 09-03-17 Pin
Duncan Edwards Jones9-Mar-17 0:37
professionalDuncan Edwards Jones9-Mar-17 0:37 
GeneralRe: WSO CCC OTD 09-03-17 Pin
PeejayAdams9-Mar-17 0:52
PeejayAdams9-Mar-17 0:52 
GeneralRe: WSO CCC OTD 09-03-17 Pin
Duncan Edwards Jones9-Mar-17 2:43
professionalDuncan Edwards Jones9-Mar-17 2:43 
GeneralRe: WSO CCC OTD 09-03-17 Pin
PeejayAdams9-Mar-17 4:07
PeejayAdams9-Mar-17 4:07 
QuestionDo Mac Users Never Use Mechanical Keyboards? Pin
Robert Vandenberg Huang8-Mar-17 21:32
professionalRobert Vandenberg Huang8-Mar-17 21:32 
AnswerRe: Do Mac Users Never Use Mechanical Keyboards? Pin
Richard MacCutchan8-Mar-17 21:38
mveRichard MacCutchan8-Mar-17 21:38 
GeneralRe: Do Mac Users Never Use Mechanical Keyboards? PinPopular
CDP18028-Mar-17 22:15
CDP18028-Mar-17 22:15 
GeneralRe: Do Mac Users Never Use Mechanical Keyboards? Pin
den2k888-Mar-17 22:28
professionalden2k888-Mar-17 22:28 
AnswerRe: Do Mac Users Never Use Mechanical Keyboards? Pin
KarstenK8-Mar-17 22:53
mveKarstenK8-Mar-17 22:53 
QuestionShould I upgrade my GPU? Pin
DaveAuld8-Mar-17 18:30
professionalDaveAuld8-Mar-17 18:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.