xboxscene.org forums

Pages: 1 [2]

Author Topic: System Ui Controls Specification  (Read 157 times)

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
System Ui Controls Specification
« Reply #15 on: February 07, 2004, 03:20:00 PM »

QUOTE (BenJeremy @ Feb 7 2004, 08:11 PM)
I'd prefer to at least keep the CONTROL node, because it's easier to parse them in proper order that way.

You do know that excessive typing is not good for health wink.gif

Well, if it can't be done without major rework, then let the Config node stay.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
System Ui Controls Specification
« Reply #16 on: February 07, 2004, 03:47:00 PM »

QUOTE (geniusalz @ Feb 7 2004, 08:18 PM)
It's even redundant (sort of, not from a technical perspective, but logically) in the other case 'blocks'.

Switch 5
CASE 1
blah
ENDCASE
CASE 2
blah
ENDCASE
CASE 3
blah
ENDCASE
ENDSWITCH

What I'm saying here is that instead of looking for an ENDCASE to end the 'block', look for a CASE or ENDSWITCH statement, like this:

Switch 5
CASE 1
blah
CASE 2
blah
CASE 3
blah
ENDSWITCH

Oh no.... that's not right.

ENDCASE forces execution to jump to the ENDSWITCH statement.

If you leave out the ones in your example, execution will proceed through the other case statements. This is on purpose, as you can provide multiple cases for a single block of code.

CODE

SWITCH %something%
CASE 1
CASE 2
blahRed
ENDCASE
CASE 3
DEFAULT
blahBlue
ENDCASE
CASE 4
blahGreen
ENDSWITCH


Even the above example has a problem... can you guess what it is? But the example is also to show that in the case of 1 and 2, blahRed will get executed. 3 and everything else, blahBlue will get executed.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
System Ui Controls Specification
« Reply #17 on: February 07, 2004, 03:50:00 PM »

QUOTE (geniusalz @ Feb 7 2004, 08:20 PM)
QUOTE (BenJeremy @ Feb 7 2004, 08:11 PM)
I'd prefer to at least keep the CONTROL node, because it's easier to parse them in proper order that way.

You do know that excessive typing is not good for health wink.gif

Well, if it can't be done without major rework, then let the Config node stay.

Oh, the config node can go, but naming the nodes after the control type is a bit of work.

I parse out nodes, in code, by calling something like this most of the time:

pXmlNode = pParentNode->GetNode("control", iIndex++);

It gives me a pointer to the "nth" node named "control", depending on the value of index - unless there are no more left, in which case it gives me a null pointer.

Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
System Ui Controls Specification
« Reply #18 on: February 07, 2004, 08:07:00 PM »

unsure.gif )
Sorry about that laugh.gif

And I think the problem is that default should go at the end, otherwise even %something% being 4 will cause it to go into default.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
System Ui Controls Specification
« Reply #19 on: February 08, 2004, 04:05:00 AM »

QUOTE (geniusalz @ Feb 8 2004, 01:07 AM)
Right.  It's just me thinking in terms of VB again (no break required; multiple cases can be done like so: Case 1,3,5,7)

And I was reading CONFIG instead of CONTROL (even though it was capitalized unsure.gif )
Sorry about that laugh.gif

And I think the problem is that default should go at the end, otherwise even %something% being 4 will cause it to go into default.

Correct on the default issue (though I hinted that in the message wink.gif ).

I updated the plug-and-play spec as well as the UI late last night. Things are still evolving as I put more pieces in place.
Logged
Pages: 1 [2]