|
Then it would come down to 3) after all. If you think about it, you may need both: Totally independent controls ans some with a parent/child relationship. The children, for example, move along when the parent is moved.
Modifying the hit test to look through the entire tree is easy. If I don't want to get into lengthy comparisons of portions of the tree in order to find out which control is in the front, I will have to get this aspect into the sorting of the tree structure as well. This way (preferrably) the first result will be the control I'm looking for.
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.
|
|
|
|
|
den2k88 wrote: Definetely Definitely
FTFTFYFY!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
What if you reversed the problem. Instead of a tree of controls that know where they live, what about a tree of space that knows what controls are in it? Meaning:
- root - the entire surface
- 4 children, each representing 1/4 quadrant of the surface
- Each of those has 4 children, representing their 1/4 of the parent's 1/4 quadrant.
- etc, down to something reasonable.
Now, a hit test traverses the spatial tree very efficiently to identify controls within a quadrant and then you just iterate through the controls in the lowest containing spatial quadrant.
The "con" of that approach is that you need to manage controls in their quadrant as they are placed, moved, and removed, and handle a control spanning up to four quadrants. However, the overhead for that is much lower because you are probably working with just a single control at that point. To make the management easier, you can also have the control know what quadrant it currently belongs to.
Marc
|
|
|
|
|
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.
|
|
|
|
|
Well, that just proves the adage "the devil is in the details." Yes, the real problem is a little more complex (not sure I would use the adjective "little", though!)
However, what you're describing sounds incredibly flexible -- workspaces within workspaces, if I read that post correct. Can't wait to see what you've come up with!
Marc
|
|
|
|
|
Yes, the workspaces are subdivided and different presenters and views are opened in the separate workspaces.
Something like this: When the program starts, there is only the root workspace and a 'controller' object is started, a kind of 'main' object as starting point. this root controller gets the main workspace.
Let's say we want the main controller to oversee three things:
1) Show some 'Hello user' splash screen or animation.
2) Display a view to log in.
3) Close all this stuff when the login was sucessful.
There are different ways to do this, but this would work:
The root controller subdivides the main workspace into two halves, let's say simply two halves of the root workspace.
Then the main controller opens a new controller that is in charge of the splash screen part and gives it one of the divisions as its own workspace. This splash controller will open a splash presenter and a splash view, which will simply do their stuff in a loop until told to stop.
The root controller will also do the same for the second half of the workspace, only that this controller is in charge of the login part. Meanwhile the root controller will sit back and wait until the login controller reports that login was successful. If it fails or is canceled, the root controller will simply terminate the program.
Meanwhile the login controller will open a login presenter and a login view in its assigned workspace, interact with the user and eventually report the results back to the root controller.
Assuming that the login was successful, the root controller will close both controllers it had open, which in turn close all views and presenters they may still have open. It will also delete its two subdivisions of the workspace, which are no longer needed.
Now it's time to open another controller, this time the main application controller. The root controller will give it its whole workspace, any data the login controller may have passed, start it and then sit and wait until the main application controller wants to end.
This already works very well, but the workspaces still are a little too static. How about giving them some visible parts after all, like handles for resizing?
The window workspaces are alternatives to this subdividing method. They are like separate windows or forms that hover over the rest of the UI. The data structures must reflect that and everything will be fine. They just don't belong at some random location within the tree.
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.
|
|
|
|
|
"Consumed during Easter, a blended meal sickens." (6,5)
Good luck.
Andy B
|
|
|
|
|
Simnel cakes (anagram of meal sickens)
Do I win £5?
Slogans aren't solutions.
|
|
|
|
|
Well done! Your turn tomorrow.
I have put your £5 in an Easter Egg hidden somewhere in the UK, don't spend it all at once!
Andy B
|
|
|
|
|
I thought that egg I found had a rather chewy centre!
Sorry...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
As long as it has a tiny picture of Jane Austen on it, I'm off to look for it!
Slogans aren't solutions.
|
|
|
|
|
I spent more time than I should have trying to fit "Seminal cakes" in even though the letter count was wrong - hadn't heard of "Simnel cakes".
Anyway - they say "you learn something new every day" so I have met quota early and can now go back to bed.
|
|
|
|
|
I rather like the idea of seminal cakes.
Quote: "... the Eccles cakes at Chez Trevor are no mere triumph of culinary delight that work their mysterious magic upon even the most jaded of palettes; they are a veritable game-changer. If ever a fat-laden, sugary confection could be described as being seminal, Chez Trev would be the place for this to occur. Bathos, pathos - these buggers have the lot - most assuredly the finest cakes known to mankind ..."
- Charles Campion (The Sunday Times)
Slogans aren't solutions.
|
|
|
|
|
Much better than Simmental [^] Cakes, which can be found in the open meadows or Ireland (and should not bee eaten)
|
|
|
|
|
Ah, those would be the ones that they sell in Gregg's.
Slogans aren't solutions.
|
|
|
|
|
One of my friends has claimed it, saying mechanical keyboards are only for PC game nerds and do not fit Apple's style.
https://rvhuang.github.io/
|
|
|
|
|
I know a number of people with MACs and they all have mechanical keyboards.
|
|
|
|
|
So it's a matter of the reformed vs. the orthodox church of Apple fanbois?
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.
|
|
|
|
|
CDP1802 wrote: deformed
FTFY
* CALL APOGEE, SAY AARDWOLF
* GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
* Never pay more than 20 bucks for a computer game.
* I'm a puny punmaker.
|
|
|
|
|
He is right, but anyone is free to try the keyboard he likes.
I have on my PC a Apple style keyboard, so the feeling is like on my iMac.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
That has been the question I have been asking myself now for a while (a good few months). I was trying to remember when my PC last got an upgrade, and then I remembered that I had written this article, and it was almost 4 years ago!
I currently have a GTX690 which is no real slouch, but video rendering etc. just takes too long.....I almost cracked last year, then of course the rumours surfaced of the GTX1080ti was on the horizon, so held off and held off.
Now it is here and shipping soon, I'm like, will I go for it or wait until the other card makers start shipping their own variants of the card. The motherboard has a 16x PCI_3 which is good, so no issues there. I was going to also leave the GTX690 in it, but that would mean with dual GPUs the PCI_3 slots drop to x8 mode. That itself shouldn't make any significant difference, so no biggy....the only issue might be the PSU...and you know what happens then, it is the wrong connectors or cables don't reach in the tower...
You know what its like though, you go out to buy some milk, and end up with a new car or a TV or something like that
If I'm going for it, I am definitely doing it before I leave this country, I can buy it and ship it in from USA with no import duty here[Qa], compared to pay the higher UK price or import duty in the next country[Cy]...
Maybe next week.....
|
|
|
|
|
Well i mean the if you are to upgrade just the GPU why would you need a new PSU, as far as i read you got a 700W PSU in the box which should suffice the hunger of an GTX 1080.
I for my self upgraded the GPU last year, from a 780 to an 980TI without replacing any other components. The new graphics cards do need less power for their output.
And Btw. i would not try to SLI 2 different Cards, SLI was designed to produce "double" the output if you have 2 cards of the same type. (Interfaces and reasons and stuff is limiting the have a 690 and a 1080 in your pc) I once talked with an GraphicsCard dealer at CBit and he mentioned that it could work but it is not safe to work. Also, why bother with SLI? You get roughly 80%, maybe 90% of the full power since syncing between the cards takes some off (At least when i thought about doing SLI it was like that). So just go for a single 1080 and have sufficient graphics power for the next 3-4 years
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
The psu upgrade would be if I was to leave the both cards in. I think my current one is only a 700w.
I wasn't going to SLI the cards, but allow them to operate independent. If/when I pull the trigger, I'll see what happens, start with the 1 and take it from there.
|
|
|
|
|
It sounds like you talked yourself into it already.
I just had my main drive go out on me yesterday. The controller went bad.
I swapped the 1 from a backup drive to the main one that I had bought at the same time.
And it worked.
Now I have 2 new controller boards on the way.
I hope they work as is.
|
|
|
|
|
You are asking if you should spend money on a new graphics card for your PC? You are asking the wrong bloke.
I'm typing this reply listening to an SACD of Dire Straights - Brothers In Arms, source is a DAC that cost £400, IEM's £1200.
Go for it, you can't take it with you.
|
|
|
|
|