Home > Coding, EMS > EMS, SPIC and that elusive Splitter Bar that does not exist…

EMS, SPIC and that elusive Splitter Bar that does not exist…

Well it’s been one of those things on my todo list, and here it is, an update on my blog about crap that I’m working on :D .

I’m finally getting back into coding full time (well full time as far as my free time allows) and I’m also enjoying the relaxing energies I seem to be getting from it, at one point after work I had to load up a first person shooter (Like Counter Strike, Team Fortress 2, etc) to get a nice relaxed level before I could start to code, but it got to the point where the time it too to reach this relaxed state took longer, until I stopped coding altogether and just played games, now I can just sit infront of VS C++ 2008 and code away (it might also have something to do with the monitor I purchased, a very nice 24″ wide screen with max res of 1920×1200 :) ).  Sometimes when coding frustrates me I load up my current choice of killing time and shoot some pilots, co-pilots, stewardesses and assorted back room staff in Left4Dead’s airport level and kill about an hour before I get back into the coding bug again – I just want to change the textures now and add some BA logo’s, or if anyone ever does a Heathrow T5 or JFK map I will download and have fun killing the zombies there.

As for my coding I’ve come to the relisation that Microsoft have made everyone lazy with the .NET framework, MFC and all the other frameworks that the compiler suppliers have provided, take the SplitterBar as an example.  The Humble splitter bar which allows you to view different sections of the same document in the same window or allowing you to change the size of subwindows inside the main window, does not actually exist within MS Windows platform API, and why should it since it’s only a bar that is easy to program right?  Wel yes and no, yes in theory it’s easy to code, but in practice it’s a lot harder that you first think.  I found a nice snippet of how to code a splitter bar on www.catch22.net, where he gives some code but not enough to just copy and paste, but enough to give you a pointer to create your own splitter bar code.  This is wher my current run of frustration is at, having got my splitter bar working on vertical bars, I thought yeah change a couple of lines of code, and viola a nice dual purpose splitter class… Or maybe not as the case goes…

I’m not infront of my code at the moment as I’m at work during a quiet period (Lunch break @ 3AM ftw) and writing this up.  Now as I said the vertical splitter bar is working great, i’ve still got a couple of tweaks to do, like set the minimum window sizes for the two panes, but it took me the best part of 9 hours to get it working correctly from scratch, and looking at the sample code that is provided by James Brown of catch22 software (his was horizonal, and the used a slightly different approach to mine and his bar went into the non client area of the window, which is something I do not want, so most of the time yesterday (to me it was yesterday, to you lot it would have been December 1st) was spent debugging / re-writing code that worked fine as long as I used the main window as the splitter bar window.

As I said I finally got the vertical bar working, now I’ve got the horizontal bar to work on, and it’s got a whole new approach to throw spanners at me.  The code *should* run correctly, and does, it’s just the splitter bar is a titles height out from where the mouse is, so I’ve got more debugging code to look forward to over my holiday.

Why am I talking about splitter bars, at this time in the morning? well it has to do with EMS, and that elusive SPIC module that I keep going on about, I’ve finally got off my big fat ass and started to code it correctly, and not only that but I’m using a nice framework for handling all the windows, when I say framework I basically mean a C++ class for the code and handling of the internal data for the windows while a win32 c style CreateWindow / WindowProc works in the background handling the messages from windows itself.  Again this is something that I found on catch22 – my new best book mark in firefox / google chrome and safari, my best bookmark in IE is still “close now” :D .  I’ll post a bit more on EMS and it’s modules as I get the chance as well as starting a few pages about other things here.

Categories: Coding, EMS Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.