If I didn't have a sense of humour I would be cross with you about now.
Ninja (the Nerd)
Confused? You will be...
If I didn't have a sense of humour I would be cross with you about now.
Ninja (the Nerd)
Confused? You will be...
"small and slow" are definitely annoying. Sometimes the big ones can be fun, though. I have a side-project which consists of many parts. They all centre around this GDI based display (like a custom powerpoint) and originally I planned to draw to a buffer (Bitmap) from a separate thread and the display would read from that buffer. For performance, there were two buffers and they swapped. Unfortunately I forgot about the whole de-allocation thing and on a 1024x768 display it leaked memory at 50MB/s.
Ninja (the Nerd)
Confused? You will be...
int x = 450;
int y = 45;
Console.WriteLine("X = " + y);
Console.WriteLine("Y = " + x);
If you ask me, this fulfils the spec. Edit: oh and this works with strings, numbers, pointers (well maybe not if it's C#), or any datatype at all really.
Ninja (the Nerd)
Confused? You will be...
So, you're walking through the forest with a canoe on your back - but when the wheels fall off: how many pancakes does it take to shingle a doghouse? (Blue because icecream has no bones)
Ninja (the Nerd)
Confused? You will be...
d@nish wrote:
There has been some privatization introduced and that will help for sure.
Isn't that what they said about the UK...
Ninja (the Nerd)
Confused? You will be...
It's so people can read the caller ID while you're on the phone to stop them asking "who's that calling you?"
Ninja (the Nerd)
Confused? You will be...
I use C# in vs08, F7 is my build key and F5 builds automatically anyway. What was that about platform-dependent algorithms?
Ninja (the Nerd)
Confused? You will be...
F5 Fix Repeat
Ninja (the Nerd)
Confused? You will be...
Ian Shlasko wrote:
That I just held down shift and mashed the number row on my keyboard
Isn't that how they create regular expressions?
Ninja (the Nerd)
Confused? You will be...
UnstableClassInDevelopment.UnStableType.UnderlyingValue obj = new UnstableClassInDevelopment.UnStableType.UnderlyingValue();
Now, if that underlying value changes type; everything breaks. With var, you don't have to do any search/replace and it works with any reasonable change. Yes, stupid example but I don't even use the thing.
Ninja (the Nerd)
Confused? You will be...
Why not just make all your own custom types 7 characters long; and build wrappers around the base classes to make them 7 characters long too?
QString bork = string.Empty
QQFloat FHeight = 12.0F
Really, what I normally do is group the declarations at the top of a class inside a #region Declarations
then shrink it when not needed.
Ninja (the Nerd)
Confused? You will be...
I could've sworn it didn't have it when I used it in .NET 2, odd.. And I meant VB when I said num *= 2
. I was trying to highlight my gripe with my last (apparently inaccurate) experience of VB, how it lacks in things I like using. Sorry if that wasn't clear. Edit: definitely my bad. I had somehow confused *= with ++. I tried writing some VB about 5 minutes ago and automatically put ; at the end of every line. :doh:
Ninja (the Nerd)
Confused? You will be...
modified on Wednesday, August 19, 2009 6:23 AM
You so could write it like that in VB. But it would be tantamount to num *= 2
err I mean num = num * 2
Curses to VB and it's lack of shorthand arithmetic operators!
Ninja (the Nerd)
Confused? You will be...
Nope, I get it. After many re-reads... :P What's timer1's Interval set to? You could try to determine if the location has changed since the last Tick event. If it hasn't, the drag is over and it should just tidy up/do nothing. I'd try just now, however that sleep I hoped for is beckoning.
Ninja (the Nerd)
Confused? You will be...
Add an event for MouseDown or MouseUp... You can check against the .Button property of the MouseEventArgs if it's the middle that was pressed. Also: You could use a MouseMove, and compare against the buttons there. So you could drag it around.
Ninja (the Nerd)
Confused? You will be...
OK sorry for the previous ludicrous suggestion. I once had a borderless window, and to handle the movement, I had added a button which, when dragged, would take the window with it. I know you're trying to reduce clicks but this could work. MouseDown: - set "moving" to true - store mouse-coords in "lastLoc" - store window position to "startPos" - start a timer MouseMove: - if moving, - move window by delta (current location - lastLoc) - update lastLoc MouseUp: - set "moving" to false - stop the timer - compare startPos with current position, etc.
Ninja (the Nerd)
Confused? You will be...
ResizeStart will only fire when the user starts to drag the edges (or you use the keyboard "shortcut" of alt+space, s, and arrow keys) and ResizeEnd fires when the user lets go. How to determine whether it was a shake or not, I would judge if the average velocity was, um... If the user was moving it one way then the other then...no, ehh On reflection it might be wiser to simply check if the window is within, say, 20 pixels of it's start location. ResizeStart: note the position, start the timer. ResizeEnd: stop the timer, compare the position, execute the function. Edit. In fact, just ignore this. It's late, I've been coding for several hours. I failed to notice that resize != move. I'll just get my coat and leave...
Ninja (the Nerd)
Confused? You will be...
Silly! IE6 couldn't rotate half the page at an arbitrary angle.
Ninja (the Nerd)
Confused? You will be...
Any notes on the velocity or vigorousness with which the window would get shaken? As for the checking if it was shaken, you may want to check if the window is within X pixels of it's original location. ResizeStart and ResizeEnd should work good.
Ninja (the Nerd)
Confused? You will be...
Just wrote this 5 minutes ago... Got a panel that displays a bunch of thumbnails of images. You can highlight these by mousing over them. In the MouseMove event for the panel, I had this... queueHighlight determinines which slide is currently highlighted. queueOffset determines the start position of what is visible. slideHovered is calculated from MouseEventArgs.X based on the thumbnail width.
if ((slideHovered + queueOffset) != queueHighlight)
{
if (queueHighlight != (slideHovered + queueOffset))
{
queueHighlight = (ushort)(slideHovered + queueOffset);
forceRender(HymnMgrTarget.QueueList); // Redraw the panel
}
else
{
queueHighlight = (ushort)(slideHovered + queueOffset);
}
}
I added the outer block when I first wrote the method. When tweaking it just then, I managed to add the inner if block, and only when I ran it and noticed that nothing had changed, did I realise my error. this.Edit(reason:="oops");
Ninja (the Nerd)
Confused? You will be...