Exemplo n.º 1
0
//----------------------------------------------------------------------------------------------------------------------
// WM INIT
//----------------------------------------------------------------------------------------------------------------------
void cDlgModeStrip::wm_init ()
{
	//--------------------------------------------
	//  IF WE'RE ON XP, REMOVE COMPOSITED STYLE
	//  BECAUSE IT MAKES THE OWNER DRAWN BUTTONS
	//  INVISIBLE
	//--------------------------------------------
	if ( ! os_version_or_higher ( 6, 0 ) )
	{
		LONG_PTR dwStyle = GetWindowLongPtr ( hwnd, GWL_EXSTYLE );
		dwStyle &= ~WS_EX_COMPOSITED;
		SetWindowLongPtr ( hwnd, GWL_EXSTYLE, dwStyle );
	}

	const int iButtonWidth = 150;

	ToggleMouseover.hwnd = GetDlgItem ( hwnd, ID_TOGGLE_MOUSEOVER );
	register_child ( &ToggleMouseover,

							  nAnchor::left,		0,		iLeftMargin,
							  nAnchor::top,			0,		iMargin,
							  nAnchor::left,		0,		iLeftMargin + iButtonWidth,
							  nAnchor::top,			0,      iMargin + iButtonHeight );

	ToggleHotkeys.hwnd = GetDlgItem ( hwnd, ID_TOGGLE_HOTKEYS );
	register_child ( &ToggleHotkeys,

							  nAnchor::left,		0,		iLeftMargin + iMargin + iButtonWidth,
							  nAnchor::top,			0,		iMargin,
							  nAnchor::left,		0,		iLeftMargin + iMargin + iButtonWidth * 2,
							  nAnchor::top,			0,      iMargin + iButtonHeight );

	ToggleWindowBroadcast.hwnd = GetDlgItem ( hwnd, ID_TOGGLE_WINDOW_BROADCAST );
	register_child ( &ToggleWindowBroadcast,

							  nAnchor::left,		0,		iLeftMargin + iMargin * 2 + iButtonWidth * 2,
							  nAnchor::top,			0,		iMargin,
							  nAnchor::left,		0,		iLeftMargin + iMargin * 2 + iButtonWidth * 3,
							  nAnchor::top,			0,      iMargin + iButtonHeight );

	ToggleComputerBroadcast.hwnd = GetDlgItem ( hwnd, ID_TOGGLE_COMPUTER_BROADCAST );
	register_child ( &ToggleComputerBroadcast,

							  nAnchor::left,		0,		iLeftMargin + iMargin * 3 + iButtonWidth * 3,
							  nAnchor::top,			0,		iMargin,
							  nAnchor::left,		0,		iLeftMargin + iMargin * 3 + iButtonWidth * 4,
							  nAnchor::top,			0,      iMargin + iButtonHeight );



}
Exemplo n.º 2
0
//----------------------------------------------------------------------------------------------------------------------
// WM INIT
//----------------------------------------------------------------------------------------------------------------------
void cDlgView::wm_init ()
{
	const int iMargin = 9;
	const int iLeftMargin = 0;

	//--------------------------------
	// MAIN LIST VIEW CONTROL
	//--------------------------------

	pListView->hwnd = GetDlgItem ( hwnd, ID_LIST_VIEW );
	register_child ( pListView,

							  nAnchor::left,		0,		iLeftMargin,
							  nAnchor::top,			0,		iMargin * 1 + s_iStripDimY,
							  nAnchor::right,		0,		-iMargin,
							  nAnchor::bottom,		0,      -iMargin );

	//--------------------------------
	// SMALL TOGGLE VIEW BUTTON
	//--------------------------------

	ToggleView.hwnd = GetDlgItem ( hwnd, ID_TOGGLE_VIEW );
	register_child ( &ToggleView,

							  nAnchor::right,		0,		- ( iMargin * 2 + s_iStripButtonDimX ),
							  nAnchor::top,			0,		iMargin + 1,
							  nAnchor::right,		0,		-( iMargin * 2 ),
							  nAnchor::top,		    0,      iMargin + s_iStripDimY - 1 );

	//--------------------------------
	// SMALL ADD BUTTON
	//--------------------------------

	Add.hwnd = GetDlgItem ( hwnd, ID_ADD  );
	register_child ( &Add,

							  nAnchor::right,		0,		- ( iMargin * 3 + s_iStripButtonDimX * 2),
							  nAnchor::top,			0,		iMargin + 1,
							  nAnchor::right,		0,		-( iMargin * 3 + s_iStripButtonDimX ),
							  nAnchor::top,		    0,      iMargin + s_iStripDimY - 1 );

	ShowWindow ( pListView->hwnd, TRUE );

	pListView->init();
	pListView->populate ( item_list() );


}
Exemplo n.º 3
0
static int run_all_tests(int childcount)
{
	int dropMode, serverFinishedPermute, serverHelloPermute, clientFinishedPermute;
	int result = 0;

	for (dropMode = 0; dropMode != 1 << (full ? 12 : 8); dropMode++)
	for (serverFinishedPermute = 0; serverFinishedPermute < 2; serverFinishedPermute++)
	for (serverHelloPermute = 0; serverHelloPermute < (full ? 120 : 6); serverHelloPermute++)
	for (clientFinishedPermute = 0; clientFinishedPermute < (full ? 120 : 6); clientFinishedPermute++) {
		int pid;
		if (!(pid = fork())) {
			exit(run_one_test(dropMode, serverFinishedPermute, serverHelloPermute, clientFinishedPermute));
		} else if (pid < 0) {
			rperror("fork");
			result = 4;
			break;
		} else {
			register_child(pid);
			result |= wait_children(childcount);
		}
	}

	result |= wait_children(0);

	return result;
}
Exemplo n.º 4
0
static int run_tests_from_id_list(int childcount)
{
	int test_id;
	int ret;
	int result = 0;

	while ((ret = fscanf(stdin, "%i\n", &test_id)) > 0) {
		int pid;
		if (test_id < 0 || test_id > 2 * (full ? 120 * 120 * (1 << 12) : 6 * 6 * 256)) {
			fprintf(stderr, "Invalid test id %i\n", test_id);
			break;
		}
		if (!(pid = fork())) {
			exit(run_test_by_id(test_id));
		} else if (pid < 0) {
			rperror("fork");
			result = 4;
			break;
		} else {
			register_child(pid);
			result |= wait_children(childcount);
		}
	}

	if (ret < 0 && ret != EOF) {
		fprintf(stderr, "Error reading test id list\n");
	}

	result |= wait_children(0);

	return result;
}
Exemplo n.º 5
0
void Window::pack_above ( Control* mNewControl, Control* mReferenceControl, byte mHorizontalPacking )
{
	mNewControl->set_position_above(mReferenceControl);
	if (mHorizontalPacking & PACK_FILL_PARENT )
	{
		mNewControl->move_to( left, mNewControl->get_bottom() );
		mNewControl->set_width_height( width, mNewControl->get_height() );		
	}
	if (mHorizontalPacking & PACK_LEFT )
	{
		//mNewControl->get_left() = left;
		mNewControl->move_to( left, mNewControl->get_bottom() );
	}
	if (mHorizontalPacking & PACK_CENTER )
	{
		//mNewControl->get_left() = (width - mNewControl->width) / 2.0;		
		mNewControl->move_to( left, mNewControl->get_bottom() );		
	}
	if (mHorizontalPacking & PACK_RIGHT )
	{
		//mNewControl->get_left()  = left+width - mNewControl->get_width();
		mNewControl->move_to( left+width - mNewControl->get_width(), mNewControl->get_bottom() );				
	}		
	register_child( mNewControl );
}
Exemplo n.º 6
0
int start_child(int fd)
{
     int pid;
     int pfd[2];

     if (pipe(pfd) < 0) {
          ci_debug_printf(1,
                          "Error creating pipe for communication with child\n");
          return -1;
     }
     if (fcntl(pfd[0], F_SETFL, O_NONBLOCK) < 0
         || fcntl(pfd[1], F_SETFL, O_NONBLOCK) < 0) {
          ci_debug_printf(1, "Error making the child pipe non-blocking\n");
          close(pfd[0]);
          close(pfd[1]);
     }
     if ((pid = fork()) == 0) { //A Child .......
          MY_PROC_PID = getpid();
          attach_childs_queue(childs_queue);
          child_data =
              register_child(childs_queue, getpid(), CONF.THREADS_PER_CHILD, pfd[1]);
          close(pfd[1]);
          child_main(fd, pfd[0]);
          exit(0);
     }
     else {
          close(pfd[0]);
          announce_child(childs_queue, pid);
          return pid;
     }
}
Exemplo n.º 7
0
// Works like a stack from top down of the window.  
void Window::pack_control( Control* mNewControl, byte mHorizontalPacking, byte mVerticalPacking )
{
	//printf("Window::pack_control:  packer: vert_pos=%6.2f; horiz_l=%6.2f horiz_r=%6.2f\n", 
	//		packer_vertical_position, packer_horizontal_l_position, packer_horizontal_r_position );
	//printf("Window::pack_control: <%6.1f,%6.1f> \n", mNewControl->left, mNewControl->bottom );

	set_vertical_position  ( mNewControl, mVerticalPacking   );
	set_horizontal_position( mNewControl, mHorizontalPacking );	
	register_child( mNewControl );
}
Exemplo n.º 8
0
//----------------------------------------------------------------------------------------------------------------------
// WM INIT
//----------------------------------------------------------------------------------------------------------------------
void cDlgToons::wm_init ()
{
	const int iMargin = 9;
	const int iLeftMargin = 0;

	iMargin, iLeftMargin;

#if 0
	const int iButtonWidth = 80;
	const int iButtonHeight = 21;

	List.hwnd = GetDlgItem ( hwnd, ID_LIST );
	register_child ( &List,
							  nAnchor::right,		0,		-iMargin,
							  nAnchor::top,			0,		iMargin,
							  nAnchor::right,		0,		-(iMargin + iButtonWidth),
							  nAnchor::top,		    0,      iMargin + iButtonHeight );

	Pictures.hwnd = GetDlgItem ( hwnd, ID_PICTURES );
	register_child ( &Pictures,
							  nAnchor::right,		0,		-(iMargin*2 + iButtonWidth*2 ),
							  nAnchor::top,			0,		iMargin,
							  nAnchor::right,		0,		-(iMargin*2 + iButtonWidth),
							  nAnchor::top,		    0,      iMargin + iButtonHeight );
#endif

#if 0
	ListView.hwnd = GetDlgItem ( hwnd, ID_LIST_VIEW );
	register_child ( &ListView,

							  nAnchor::left,		0,		iLeftMargin,
							  nAnchor::top,			0,		iMargin * 2 + s_iButtonStripHeight,
							  nAnchor::right,		0,		-iMargin,
							  nAnchor::bottom,		0,      -iMargin );

	ListView.init();


	cToonList tl ( g_Config.ToonList );
	ListView.populate ( &tl );
#endif
}
Exemplo n.º 9
0
int start_child(int fd){
     int pid;
     if((pid=fork())==0){//A Child .......
	  attach_childs_queue(&childs_queue);
	  child_data=register_child(&childs_queue,getpid(),START_SERVERS);
	  child_main(fd);
	  exit(0);
     }
     else
	  return pid;
}
Exemplo n.º 10
0
void Window::pack_below  (Control* mNewControl, Control* mReferenceControl, byte mHorizontalPacking)
{
	mNewControl->set_position_below(mReferenceControl);

	if (mHorizontalPacking & PACK_COPY_HORIZ)
	{
		mNewControl->move_to( mReferenceControl->get_left(),  mNewControl->get_bottom() );
		mNewControl->set_width_height( mReferenceControl->get_width(), mNewControl->get_height() );
		
	} else 
		set_horizontal_position( mNewControl, mHorizontalPacking );

	register_child( mNewControl );
}
Exemplo n.º 11
0
int start_child(int fd)
{
     int pid;
     int pfd[2];
     int children_num, free_servers, used_servers, max_requests;

     if (pipe(pfd) < 0) {
          ci_debug_printf(1,
                          "Error creating pipe for communication with child\n");
          return -1;
     }
     if (fcntl(pfd[0], F_SETFL, O_NONBLOCK) < 0
         || fcntl(pfd[1], F_SETFL, O_NONBLOCK) < 0) {
          ci_debug_printf(1, "Error making the child pipe non-blocking\n");
          close(pfd[0]);
          close(pfd[1]);
     }
     if ((pid = fork()) == 0) { //A Child .......
          MY_PROC_PID = getpid();
          if (!attach_childs_queue(childs_queue)) {
              ci_debug_printf(1, "Can not access shared memory for %d child\n", (int)MY_PROC_PID);
              exit(-2);
          }
          child_data =
              register_child(childs_queue, getpid(), CI_CONF.THREADS_PER_CHILD, pfd[1]);
          if (!child_data) {
              childs_queue_stats(childs_queue, &children_num, &free_servers,
                                 &used_servers, &max_requests);
              ci_debug_printf(1, "Not available slot in shared memory for %d child (Number of slots: %d, Running children: %d, Free servers: %d, Used servers: %d)!\n", (int)MY_PROC_PID,
                              childs_queue->size,
                              children_num,
                              free_servers,
                              used_servers
                  );
              exit(-3);
          }
          close(pfd[1]);
          child_main(fd, pfd[0]);
          exit(0);
     }
     else {
          close(pfd[0]);
          announce_child(childs_queue, pid);
          return pid;
     }
}
Exemplo n.º 12
0
/* Extends the latest level.  ie. works from the current BasePath plus
a new item  */
void FileBrowser::add_level( string mAppendPath )
{
	if (Debug) printf( "add_level : %s \n", mAppendPath.c_str() );
	DirectoryListBox*  tmp_dir  = new DirectoryListBox();
	tmp_dir->set_color_scheme( DefaultColorSet );
	tmp_dir->populate_directories( mAppendPath.c_str(), 1 );

	// Set the Header text:
	size_t last_pos = mAppendPath.find_last_of('/',mAppendPath.length()-2);	
	string directory_name = mAppendPath.substr( last_pos, string::npos );	
	tmp_dir->set_header_text( directory_name, 0 );
	
	float ht = height - path_descriptor->get_height();
	tmp_dir->set_width_height( 200, ht );		// height will get overwritten
	tmp_dir->populate_files( mAppendPath.c_str(), 1 );

	register_child  (tmp_dir);
	levels.push_back(tmp_dir);	
	tmp_dir->z_order = -1;
}
Exemplo n.º 13
0
/* Start with just 1 level */
void FileBrowser::create_file_browser( )
{
	// Show Path across the top : 
	if (Debug) printf("FileBrowser::create_file_browser() %s \n", base_path.c_str() );
	path_descriptor = new TextView	( width, 32 );
	path_descriptor->set_text		( base_path.c_str() );
	path_descriptor->set_text_size  ( 14 );
	path_descriptor->onCreate		( );
	
	float h = bottom+height - path_descriptor->get_height();

	if (Debug) printf(" %s \n", base_path.c_str() );	
	path_descriptor->move_to		(left, h );
	path_descriptor->print_positions();
	register_child( path_descriptor );

	// Create the first file List :
	//add_level( base_path );
	//onPlace();
	//print_window_positions();
}
Exemplo n.º 14
0
/**
 * seahorse_object_set_parent:
 * @self: the child
 * @value: the parent
 *
 * register @value as the parent of @self:
 */
void
seahorse_object_set_parent (SeahorseObject *self, SeahorseObject *value)
{
	g_return_if_fail (SEAHORSE_IS_OBJECT (self));
	g_return_if_fail (self->pv->parent != self);
	g_return_if_fail (value != self);
	
	if (value == self->pv->parent)
		return;
	
	/* Set the new parent/child relationship */
	if (self->pv->parent != NULL)
		unregister_child (self->pv->parent, self);

	if (value != NULL)
		register_child (value, self);
	
	g_assert (self->pv->parent == value);

	g_object_notify (G_OBJECT (self), "parent");
}
Exemplo n.º 15
0
void
orphand_process_message(orphand_server *srv,
                        orphand_client *cli,
                        const orphand_message *msg)
{
    INFO("Sock: %d, Action=%d, Parent=%d, Child=%d",
          cli->sockfd,
          msg->action,
          msg->parent,
          msg->child);
    if (msg->action == ORPHAND_ACTION_REGISTER) {
        register_child(msg->parent, msg->child);
    } else if (msg->action == ORPHAND_ACTION_UNREGISTER) {
        unregister_child(msg->parent, msg->child);
    } else if (msg->action == ORPHAND_ACTION_PING) {

        uint32_t *reply =
                (uint32_t*)((char*)cli->sndbuf.buf + cli->sndbuf.used);
        if (cli->sndbuf.total - cli->sndbuf.used < 12) {
            ERROR("Too little space in send buffer..");
            return;
        }

        reply[0] = msg->parent;
        reply[1] = msg->child;
        reply[2] = msg->action;
        cli->sndbuf.used += 12;

    } else {
        ERROR("Received unknown code %d", msg->action);
        ERROR("A=%d,P=%d,C=%d",
              msg->action,
              msg->parent,
              msg->child);
    }
}
Exemplo n.º 16
0
int do_child()
{
     HANDLE hStdin, child_handle, parent_pipe;
     DWORD dwRead;
     WSAPROTOCOL_INFO sock_info;
     ci_socket sock_fd;

     hStdin = GetStdHandle(STD_INPUT_HANDLE);
     if ((hStdin == INVALID_HANDLE_VALUE))
          ExitProcess(1);

//   ReadFile(hStdin, buf, 512, &dwRead, NULL); 
//   printf("Reading \"%s\" from server\n",buf);

//   sscanf(buf,"%d:%d:%d:%d:%d",&child_handle,&accept_mutex,
//                          &(childs_queue.shmid),&(childs_queue.queue_mtx),
//        &(childs_queue.size));

     if (!ReadFile(hStdin, &child_handle, sizeof(HANDLE), &dwRead, NULL)
         || dwRead != sizeof(HANDLE)) {
          ci_debug_printf(1, "Error reading handles.....\n");
          exit(0);
     }

     if (!ReadFile(hStdin, &parent_pipe, sizeof(HANDLE), &dwRead, NULL)
         || dwRead != sizeof(HANDLE)) {
          ci_debug_printf(1, "Error reading handles.....\n");
          exit(0);
     }

     if (!ReadFile(hStdin, &accept_mutex, sizeof(HANDLE), &dwRead, NULL)
         || dwRead != sizeof(HANDLE)) {
          ci_debug_printf(1, "Error reading handles.....\n");
          exit(0);
     }
     if (!ReadFile(hStdin, &(childs_queue.shmid), sizeof(HANDLE), &dwRead, NULL)
         || dwRead != sizeof(HANDLE)) {
          ci_debug_printf(1, "Error reading handles.....\n");
          exit(0);
     }
     if (!ReadFile
         (hStdin, &(childs_queue.queue_mtx), sizeof(HANDLE), &dwRead, NULL)
         || dwRead != sizeof(HANDLE)) {
          ci_debug_printf(1, "Error reading handles.....\n");
          exit(0);
     }
     if (!ReadFile(hStdin, &(childs_queue.size), sizeof(int), &dwRead, NULL) ||
         dwRead != sizeof(int)) {
          ci_debug_printf(1, "Error reading handles.....\n");
          exit(0);
     }

     if (!ReadFile
         (hStdin, &(sock_info), sizeof(WSAPROTOCOL_INFO), &dwRead, NULL)
         || dwRead != sizeof(WSAPROTOCOL_INFO)) {
          ci_debug_printf(1, "Error reading handles.....\n");
          exit(0);
     }

     if ((sock_fd = WSASocket(FROM_PROTOCOL_INFO,
                              FROM_PROTOCOL_INFO,
                              FROM_PROTOCOL_INFO,
                              &(sock_info), 0, 0)) == INVALID_SOCKET) {
          ci_debug_printf(1, "Error in creating socket :%d\n",
                          WSAGetLastError());
          return 0;
     }


     if (!attach_childs_queue(&childs_queue)) {
          ci_debug_printf(1, "Error in new child .....\n");
          return 0;
     }
     ci_debug_printf(1, "Shared memory attached....\n");
     child_data =
         register_child(&childs_queue, child_handle, START_SERVERS,
                        parent_pipe);
     ci_debug_printf(1, "child registered ....\n");

     child_main(sock_fd);
     exit(0);
}
Exemplo n.º 17
0
/* This takes a control which has absolute positioning.  and puts it in reference of the 
   window's <left,bottom>

   This will add the window offsets before registering the control.   
   This means the Control's left, bottom are offsets from the Window's!
*/
int	Window::add_control_local_coords( Control* mControl )
{
	mControl->move_by( left, bottom ); 
	register_child( mControl );	
	return 1;
}
Exemplo n.º 18
0
int	Window::add_control ( Control* mControl )
{
	register_child( mControl );	
	return 1;
}
Exemplo n.º 19
0
//----------------------------------------------------------------------------------------------
// WM INIT
//----------------------------------------------------------------------------------------------
void cDlgSetTrigger :: wm_init ()
{
	CheckDlgButton ( hwnd, ID_PRESSED, TRUE );

	set_text ();

	RECT r;
	GetWindowRect ( hwnd, &r );
	iInitialWindowHeight = r.bottom - r.top;

	int iCtrlDimY = 23;
	int iMarginY  = 12;
	int iGutterY  = 6;

	iInitialComboPosY = 81;

	HWND hHead = GetDlgItem ( hwnd, ID_HEAD );
	SetWindowFont ( hHead, g_hDialogBoxHeadFont, TRUE );

	mojo::register_for_key_events ( /* &KeyBuf, */ hwnd );
	mojo::start_swallowing_key_events ( hwnd );

	add_combo();

	const int iDimX        = 90;

	int iLockDimX = 160;
	int iLockPosX = iMarginX * 2;
	int iLockBottom = iMarginY + iCtrlDimY * 3;
	int iPressedBottom = iLockBottom + 3 * iCtrlDimY + iMarginY;

	//---------------------------------
	//  PRESSED STUFF
	//---------------------------------

	PressedLabel.hwnd = GetDlgItem ( hwnd, ID_PRESSED_LABEL );
	PressedLabel.init();
	register_child ( &PressedLabel,
							  nAnchor::left,		0,		iMarginX,
							  nAnchor::bottom,		0,		- ( iPressedBottom + 3 * iCtrlDimY ) ,
							  nAnchor::right,		0,		-iMarginX,
							  nAnchor::bottom,		0,      - ( iPressedBottom + 2 * iCtrlDimY )  );

	Pressed.hwnd = GetDlgItem ( hwnd, ID_PRESSED );
	register_child ( &Pressed,
							  nAnchor::left,		0,		iLockPosX ,
							  nAnchor::bottom,		0,		- ( iPressedBottom + 2 * iCtrlDimY ),
							  nAnchor::left,		0,		iLockPosX + iLockDimX,
							  nAnchor::bottom,		0,      - ( iPressedBottom + iCtrlDimY ) );

	Released.hwnd = GetDlgItem ( hwnd, ID_RELEASED );
	register_child ( &Released,
							  nAnchor::left,		0,		iLockPosX ,
							  nAnchor::bottom,		0,		- ( iPressedBottom + iCtrlDimY ),
							  nAnchor::left,		0,		iLockPosX + iLockDimX,
							  nAnchor::bottom,		0,      - iPressedBottom );

	//---------------------------------
	//  LOCK STUFF
	//---------------------------------
	
	LockLabel.hwnd = GetDlgItem ( hwnd, ID_LOCK_LABEL );
	LockLabel.init();
	register_child ( &LockLabel,
							  nAnchor::left,		0,		iMarginX,
							  nAnchor::bottom,		0,		- ( iLockBottom + 3 * iCtrlDimY ) ,
							  nAnchor::right,		0,		-iMarginX,
							  nAnchor::bottom,		0,      - ( iLockBottom + 2 * iCtrlDimY  )  );

	CapsLockOn.hwnd = GetDlgItem ( hwnd, ID_CAPSLOCK_ON );
	register_child ( &CapsLockOn,
							  nAnchor::left,		0,		iLockPosX,
							  nAnchor::bottom,		0,		- ( iLockBottom + 2 * iCtrlDimY  ) ,
							  nAnchor::left,		0,		iMarginX + iLockDimX,
							  nAnchor::bottom,		0,      - ( iLockBottom + 1 * iCtrlDimY  )  );

	NumLockOn.hwnd = GetDlgItem ( hwnd, ID_NUMLOCK_ON );
	register_child ( &NumLockOn,
							  nAnchor::left,		0,		iLockPosX + iLockDimX,
							  nAnchor::bottom,		0,		- ( iLockBottom + 2 * iCtrlDimY  ) ,
							  nAnchor::left,		0,		iMarginX + 2 * iLockDimX,
							  nAnchor::bottom,		0,      - ( iLockBottom + 1 * iCtrlDimY  )  );

	ScrollLockOn.hwnd = GetDlgItem ( hwnd, ID_SCROLLLOCK_ON );
	register_child ( &ScrollLockOn,
							  nAnchor::left,		0,		iLockPosX + 2* iLockDimX,
							  nAnchor::bottom,		0,		- ( iLockBottom + 2 * iCtrlDimY  ) ,
							  nAnchor::left,		0,		iMarginX + 3 * iLockDimX,
							  nAnchor::bottom,		0,      - ( iLockBottom + 1 * iCtrlDimY  )  );

	CapsLockOff.hwnd = GetDlgItem ( hwnd, ID_CAPSLOCK_OFF );
	register_child ( &CapsLockOff,
							  nAnchor::left,		0,		iLockPosX,
							  nAnchor::bottom,		0,		- ( iLockBottom + iCtrlDimY ),
							  nAnchor::left,		0,		iMarginX + iLockDimX,
							  nAnchor::bottom,		0,      - iLockBottom );

	NumLockOff.hwnd = GetDlgItem ( hwnd, ID_NUMLOCK_OFF );
	register_child ( &NumLockOff,
							  nAnchor::left,		0,		iLockPosX + iLockDimX,
							  nAnchor::bottom,		0,		- ( iLockBottom + iCtrlDimY ),
							  nAnchor::left,		0,		iMarginX + 2 * iLockDimX,
							  nAnchor::bottom,		0,      - iLockBottom );

	ScrollLockOff.hwnd = GetDlgItem ( hwnd, ID_SCROLLLOCK_OFF );
	register_child ( &ScrollLockOff,
							  nAnchor::left,		0,		iLockPosX + 2* iLockDimX,
							  nAnchor::bottom,		0,		- ( iLockBottom + iCtrlDimY ),
							  nAnchor::left,		0,		iMarginX + 3 * iLockDimX,
							  nAnchor::bottom,		0,      - iLockBottom );


	//---------------------------------
	//  BOTTOM BUTTONS
	//---------------------------------

	Clear.hwnd = GetDlgItem ( hwnd, ID_CLEAR );
	register_child ( &Clear,
							  nAnchor::left,		0,		iMarginX,
							  nAnchor::bottom,		0,		- ( 1 * iMarginY + iCtrlDimY ),
							  nAnchor::left,		0,		iMarginX + iDimX,
							  nAnchor::bottom,		0,      - ( 1 * iMarginY ) );

	OK.hwnd = GetDlgItem ( hwnd, IDOK );
	register_child ( &OK,
							  nAnchor::right,		0,		- ( iMarginX * 2 + iDimX * 2 ), 
							  nAnchor::bottom,		0,		- ( 1 * iMarginY + iCtrlDimY ),
							  nAnchor::right,		0,		- ( iMarginX * 2 + iDimX  ),
							  nAnchor::bottom,		0,      - ( 1 * iMarginY ) );

	Cancel.hwnd = GetDlgItem ( hwnd, IDCANCEL );
	register_child ( &Cancel,
							  nAnchor::right,		0,		- ( iMarginX * 1 + iDimX * 1 ), 
							  nAnchor::bottom,		0,		- ( 1 * iMarginY + iCtrlDimY ),
							  nAnchor::right,		0,		- ( iMarginX * 1 ),
							  nAnchor::bottom,		0,      - ( 1 * iMarginY ) );

	Link.hwnd = GetDlgItem ( hwnd, ID_LINK );
	register_child ( &Link,
							  nAnchor::left,		0,		iMarginX,
							  nAnchor::bottom,		0,		- ( 3 * iGutterY + 2 * iCtrlDimY ),
							  nAnchor::left,		0,		iMarginX + 200,
							  nAnchor::bottom,		0,      - ( 3 * iGutterY + iCtrlDimY) );

	this->reposition_children ();
}