Not a horror, but still ugly
-
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... -
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... -
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...At least you spotted and admitted it!
Weight loss Target Weight at start [1/Feb/2009] 127kg Weight now [31/Jul/2009] 107.7kg Target weight : 80kg Only 28 TO go hope to be there by March Wish me luck!
-
At least you spotted and admitted it!
Weight loss Target Weight at start [1/Feb/2009] 127kg Weight now [31/Jul/2009] 107.7kg Target weight : 80kg Only 28 TO go hope to be there by March Wish me luck!