|
|
Had I noticed Griffs post we could have avoided all of this...
But I guess a Riddler needs a good laugh now and then... or are you some kind of Joker?
|
|
|
|
|
Hmm.
Not Davey Crockett[^], then, because that's repetitions of four words: "Davey", "Crockett", "dum", and "di" (they way I sing it, at least).
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Not really, it's more like the other way around. Whatever caused the problem quietly went away and just worked like a charm when I wanted to take another look at it. Perhaps I have frienly Kobolds or Elves in my house that secretly fixed it overnight.
I was working on the sample program to demonstrate my UI again. This time I'm grimly determined to write an article about it. I'm a little proud of that particular bit of code and I think it may be far enough to be of use to other people.
This is the XAML for a small view (as in Model View Presenter). Since the 3D engine is not running in the background, this view just fills the background with an image and a button to end the program that comes useful when the program runs in fullscreen mode:
<BackgroundView Id="BackgroundView" Width="1024" Height="768" DockStyle="ADAPT"
xmlns="clr-namespace:FoC.PraetorUIDemo.Presentation.Views;assembly=PraetorUIDemo"
xmlns:fw="clr-namespace:Microsoft.Xna.Framework;assembly=MonoGame.Framework"
xmlns:foc="clr-namespace:FoC.Praetor4UI.Controls;assembly=Praetor4UI"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<foc:cPraeImage Id="ImgBackground" PositionX="0" PositionY="0" Width="1024" Height="768" Alpha="255" ImagePosition="SCALE" Image="Background" >
<foc:cPraeImageButton Id="BtnTerminate" Image="Button_96" PositionX="918" PositionY="10" Width="96" Height="20" Text="Exit" LeftButtonClicked="BtnTerminateProgram_LeftButtonClicked"/>
</foc:cPraeImage>
</BackgroundView>
The click event of the button should be wired up to its event handler like this:
LeftButtonClicked="BtnTerminateProgram_LeftButtonClicked"
This never worked up to now. Since I don't enjoy the comfort of a designer that generates things like that in a partial class, I had to write code like this for every control:
public override void Initialize()
{
m_BtnTerminateProgram = Controls.GetComponent("BtnTerminate") as cPraeImageButton;
if (m_BtnTerminateProgram != null)
{
m_BtnTerminateProgram.LeftButtonClicked += new
PraeMouseButtonEvent(BtnTerminateProgram_LeftButtonClicked);
}
}
This worked, but for larger views with many controls this meant to write a awkwardly long method. Not anymore! Wiring up the button from XAML now works without any additional code in the Initialize() method.
Thanks, Elves!
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.
modified 11-Mar-17 5:41am.
|
|
|
|
|
What does m_ mean?
What does the tiny little c in front of PraeImageButton mean?
What does Btn stand for?
I am giving you hard time here but in our shop you have no choice but to name the control TerminateProgramButton . Your code would fail review any other way.
-- Thanks for sharing.
|
|
|
|
|
Slacker007 wrote: What does m_ mean?
Mine!
Slacker007 wrote: What does the tiny little c in front of PraeImageButton mean?
Charlies!
Slacker007 wrote: What does Btn stand for?
Barry Timothy Norman.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
Good that he did not ask what the namespace FoC[^] stands for.
I think I should call my Padawan and set up some content on that site once more.
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.
|
|
|
|
|
You have hit a hot topic there. I have been at war with those elaborate naming and style conventions for a long time.
Hungarion notation is not a bad thing at all, at least if you use it as it was meant to be and not simply as a type prefix. The typical 'we have Intellisense' argument also does not really fit anymore then and Intellisense usually fails me when I need it most. Besides that, I often must use editors that don't have any Intellisense.
Maybe I would not pass a review in your shop, but you would probably pass them in mine. The problem is that if you want to cover every possible case, you end up with a rulebook thicker than the German tax legislation. Been there, done that. With every review some new rules were added and, for my part, I hated it more every time I had to do a review.
The compiler does not care about any of this as long as the code is sytactically correct. Thw whole circus is just for us and I think there are more important things to look at in a code review than spending 90% of the time obscessing over wether or not someone should have captalized a name or not.
We are all intelligent people, so why can't we stick to essentials, keep the rulebook thin and allow a little anarchy within certain boundaries (Nerds and buerocrats avert your eyes). Conventions like using hungarion or not should be agreed upon by the team and then be used accordingly, but it's not the end of the world when someone accidentally or with some intention writes his stuff differently.
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.
|
|
|
|
|
lol notations and Patterns... all Needs to be served first.
I'm asking me when the Team can start wo(r)king.
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Good idea. Ask five programmers and you get twenty opinions. That's exactly how those style bibles with their endless rules come to be.
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.
|
|
|
|
|
a
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Slacker007 wrote: but in our shop you have no choice but to name the control TerminateProgramButton . I have to ask - does your company also place that degree of attention to code clarity, performance, security and extensibility in code reviews?
/ravi
|
|
|
|
|
|
/ravi
|
|
|
|
|
|
I call that kind of project a hamster wheel. You can keep running in it as much as you want, but never arrive anywhere. Just look at my post after yours and you know my current hamster wheel.
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.
|
|
|
|
|
It is my experience that as far as developers are concerned, the effect is cause by crappy project managers and/or customers who argue internally and can't make up their mind how they want it...
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Not always: I worked with one "developer" years ago who got asked to fix bug A.
The fix caused bug B, so that had to be fixed.
The fix for bug B caused bug A, so the same fix was done again.
And again.
And again.
Until the customer said "sod this for a lark" and sent all the kit back...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
A photon wouldn't experience Zeno's paradox since it doesn't experience time. Only an external observer would - and this is the same with software projects. Developers exist in a state without any concept of time but only external observers (managers, spouses, security guards wanting to lock the building) do.
|
|
|
|
|
I've often wondered where Microsoft got its business model... Thanks for that!
Will Rogers never met me.
|
|
|
|
|
It always amazes me how so many people can spend so much time fantasizing (they can call it "rationalising", "investigating", or "calculating" as much as they like, but it's still "fantasizing) about simple arithmetic situations that cannot happen in reality.
It's kinda the antithesis of science: in particular, Maths.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Former Formula 1 and motorcycling world champion John Surtees has died at the age of 83.
I met him on several occasions when I was involved in classic bike racing. A true great of motorsport.
veni bibi saltavi
|
|
|
|
|
|
Sad news. This dual achievement will probably never be repeated because of the changed nature of the sports. His passing remains totally unreported in Oz which is actually surprising.
Peter Wasser
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." - Bertrand Russell
|
|
|
|