Beispiel #1
0
void palette_scenery_load(void)
{
	int						n,type,main_idx,sub_idx;
	map_scenery_type		*scenery;

		// get scenery
		
	select_get(0,&type,&main_idx,&sub_idx);
	scenery=&map.sceneries[main_idx];

		// set controls
	
	dialog_special_combo_fill_model(palette_scenery_wind,kSceneryModelName,0,scenery->model_name);
	dialog_set_text(palette_scenery_wind,kSceneryAnimationName,0,scenery->animation_name);
	dialog_set_float(palette_scenery_wind,kSceneryAngleX,0,scenery->ang.x);
	dialog_set_float(palette_scenery_wind,kSceneryAngleY,0,scenery->ang.y);
	dialog_set_float(palette_scenery_wind,kSceneryAngleZ,0,scenery->ang.z);
	dialog_set_float(palette_scenery_wind,kSceneryResize,0,scenery->resize);
	dialog_set_boolean(palette_scenery_wind,kSceneryContactObject,0,scenery->contact_object_on);
	dialog_set_boolean(palette_scenery_wind,kSceneryContactProjectile,0,scenery->contact_projectile_on);
	dialog_set_boolean(palette_scenery_wind,kSceneryContactHitBox,0,scenery->contact_hit_box);
	dialog_set_boolean(palette_scenery_wind,kSceneryFaceFront,0,scenery->face_forward);
	dialog_set_boolean(palette_scenery_wind,kSceneryShadow,0,scenery->shadow);
	
	for (n=0;n!=max_map_scenery_model_texture_frame;n++) {
		dialog_set_int(palette_scenery_wind,kSceneryFrame,n,(int)scenery->texture_frame[n]);
	}

	DrawControls(palette_scenery_wind);
}
Beispiel #2
0
/**
 *  Zeichenmethode
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 *
 *  @author FloSoft
 */
bool ctrlTable::Draw_(void)
{
	Draw3D(GetX(), GetY(), width, height, tc, 2);

	DrawControls();

	unsigned short lines = static_cast<unsigned short>((line_count > rows.size() ? rows.size() : line_count));
	ctrlScrollBar *scroll = GetCtrl<ctrlScrollBar>(0);

	for(unsigned short i = 0; i < lines; ++i)
	{
		if(row_l_selection == i + scroll->GetPos())
		{
			// durchsichtig schwarze Markierung malen
			DrawRectangle(GetX() + 2, GetY() + 2 + header_height + i*font->getHeight(), width - 4 - (scroll->GetVisible() ? 24 : 0), font->getHeight(), 0x80000000);
		}

		unsigned short pos = 0;
		for(unsigned short c = 0; c < columns.size(); ++c)
		{
			if(columns.at(c).width == 0)
				continue;

			font->Draw(GetX()+2+pos, GetY()+2 + header_height + i*font->getHeight(),rows.at(i+scroll->GetPos()).columns.at(c), 0, (row_l_selection == i + scroll->GetPos() ? 0xFFFFAA00 : COLOR_YELLOW), 0, GetCtrl<ctrlButton>(c+1)->GetWidth(), "");
			pos += GetCtrl<ctrlButton>(c+1)->GetWidth();
		}
	}

	return true;
}
Beispiel #3
0
Datei: ugView.c Projekt: rolk/ug
static void RefreshCommand (void)
{
  int error;
  FILE *stream;

  if (globalState!=OPENED) return;

  /* set volume */
  error = SetVol(NULL,vRefNum);
  if (((int)error)!=0)
  {
    OneButtonBox("Could not set volume","OK");
    return;
  }

  stream = fopen(fileName,"rb");
  if (stream==NULL)
  {
    OneButtonBox("Could not open file","OK");
    return;
  }

  /* draw something */
  RasterizeFile(stream,&myWindow,fx,fy);
  fclose(stream);

  DrawGrowIcon(myWindow.theWindow);
  DrawControls(myWindow.theWindow);

  return;
}
Beispiel #4
0
/**
 *  Zeichenmethode
 *
 *  @author FloSoft
 */
bool ctrlGroup::Draw_()
{
    // Steuerelemente zeichnen
    DrawControls();

    return true;
}
/**
 *  Zeichenmethode.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 *
 *  @author OLiver
 */
bool ctrlList::Draw_()
{
    ctrlScrollBar* scrollbar = GetCtrl<ctrlScrollBar>(0);

    // Box malen
    Draw3D(GetX(), GetY(), width_, height_, tc, 2);

    // Scrolleiste zeichnen
    DrawControls();

    // Wieviele Linien anzeigen?
    unsigned show_lines = (pagesize > lines.size() ? unsigned(lines.size()) : pagesize);

    // Listeneinträge zeichnen
    for(unsigned short i = 0; i < show_lines; ++i)
    {
        // Schwarze Markierung, wenn die Maus drauf ist
        if(i == mouseover)
            DrawRectangle(GetX() + 2, GetY() + 2 + i * font->getHeight(), width_ - 22, font->getHeight(), 0x80000000);

        // Text an sich
        font->Draw(GetX() + 2, GetY() + 2 + i * font->getHeight(), lines[i + scrollbar->GetPos()], 0, (selection_ == i + scrollbar->GetPos() ? 0xFFFFAA00 : 0xFFFFFF00), 0, width_ - 22);
    }

    return true;
}
void dialog_pose_move_settings_load(void)
{
	int							mesh_idx;
	model_pose_move_type		*pose_move;
	
	pose_move=&model.animates[dialog_animate_idx].pose_moves[dialog_pose_move_idx];
		
		// set controls

	dialog_set_combo(dialog_animation_settings_wind,kAnimationPosePose,0,pose_move->pose_idx);
	
	dialog_set_int(dialog_animation_settings_wind,kAnimationPoseTime,0,pose_move->msec);
	dialog_set_value(dialog_animation_settings_wind,kAnimationPoseAccel,0,(int)(pose_move->acceleration*100.0f));

	dialog_set_float(dialog_animation_settings_wind,kAnimationPoseSwayX,0,pose_move->sway.x);
	dialog_set_float(dialog_animation_settings_wind,kAnimationPoseSwayY,0,pose_move->sway.y);
	dialog_set_float(dialog_animation_settings_wind,kAnimationPoseSwayZ,0,pose_move->sway.z);
	dialog_set_float(dialog_animation_settings_wind,kAnimationPoseMoveX,0,pose_move->mov.x);
	dialog_set_float(dialog_animation_settings_wind,kAnimationPoseMoveY,0,pose_move->mov.y);
	dialog_set_float(dialog_animation_settings_wind,kAnimationPoseMoveZ,0,pose_move->mov.z);

	dialog_set_bone_combo(dialog_animation_settings_wind,kAnimationSoundBone,0,pose_move->sound.bone_idx);
	dialog_special_combo_fill_sound(dialog_animation_settings_wind,kAnimationSoundName,0,pose_move->sound.name);
	dialog_set_float(dialog_animation_settings_wind,kAnimationSoundPitch,0,pose_move->sound.pitch);
	dialog_set_boolean(dialog_animation_settings_wind,kAnimationSoundGlobal,0,pose_move->sound.no_position);
	
	dialog_particle_idx=-1;
	
	RemoveDataBrowserItems(dialog_particle_list,kDataBrowserNoItem,0,NULL,kDataBrowserItemNoProperty);
	AddDataBrowserItems(dialog_particle_list,kDataBrowserNoItem,pose_move->particle.count,NULL,kDataBrowserItemNoProperty);

	dialog_ring_idx=-1;
	
	RemoveDataBrowserItems(dialog_ring_list,kDataBrowserNoItem,0,NULL,kDataBrowserItemNoProperty);
	AddDataBrowserItems(dialog_ring_list,kDataBrowserNoItem,pose_move->ring.count,NULL,kDataBrowserItemNoProperty);
	
	dialog_set_bone_combo(dialog_animation_settings_wind,kAnimationFlashBone,0,pose_move->flash.bone_idx);
	dialog_set_int(dialog_animation_settings_wind,kAnimationFlashIntensity,0,pose_move->flash.intensity);
	dialog_set_int(dialog_animation_settings_wind,kAnimationFlashLiveTime,0,pose_move->flash.flash_msec);
	dialog_set_int(dialog_animation_settings_wind,kAnimationFlashFadeTime,0,pose_move->flash.fade_msec);
	
	dialog_set_color(dialog_animation_settings_wind,kAnimationFlashColor,0,&pose_move->flash.col);
	
	dialog_set_int(dialog_animation_settings_wind,kAnimationShakeDistance,0,pose_move->shake.distance);
	dialog_set_int(dialog_animation_settings_wind,kAnimationShakeSize,0,pose_move->shake.size);
	dialog_set_int(dialog_animation_settings_wind,kAnimationShakeLiveTime,0,pose_move->shake.life_msec);
	
	mesh_idx=model_find_mesh(&model,pose_move->mesh_fade.name);
	if (mesh_idx==-1) {
		dialog_set_combo(dialog_animation_settings_wind,kAnimationMeshName,0,0);
	}
	else {
		dialog_set_combo(dialog_animation_settings_wind,kAnimationMeshName,0,(mesh_idx+2));
	}
	dialog_set_int(dialog_animation_settings_wind,kAnimationMeshFadeInTime,0,pose_move->mesh_fade.fade_in_msec);
	dialog_set_int(dialog_animation_settings_wind,kAnimationMeshFadeLifeTime,0,pose_move->mesh_fade.fade_life_msec);
	dialog_set_int(dialog_animation_settings_wind,kAnimationMeshFadeOutTime,0,pose_move->mesh_fade.fade_out_msec);
	
	DrawControls(dialog_animation_settings_wind);
}
Beispiel #7
0
Datei: ugView.c Projekt: rolk/ug
static int CreateApplicationWindow (AWindowRecord *wr, char *fname, short h, short v, short dh, short dv)
{
  Rect r;
  GrafPtr myPort;
  PaletteHandle myPalette;
  char name[80];

  /* init AWindowRecord */
  wr->theWindow = (WindowPtr) wr;

  /* read in resources */
  if (GetNewCWindow(appWinId,(Ptr)wr,(WindowPtr) -1)==NULL)
  {
    return(1);
  }
  myPalette = GetNewPalette(defaultPaletteId);
  SetPalette(wr->theWindow,myPalette,false);

  /* move and size window */
  myPort = (GrafPtr) wr->theWindow;
  SetPort(myPort);
  MoveWindow(wr->theWindow,h,v,false);
  SizeWindow(wr->theWindow,dh+15,dv+15,false);
  strcpy(name,fname);
  SetWTitle(wr->theWindow,c2pstr(name));
  ShowWindow(wr->theWindow);
  SelectWindow(wr->theWindow);
  DrawGrowIcon(wr->theWindow);
  r = myPort->portRect;

  TextFont(kFontIDMonaco);

  /* get the scroll bars */
  wr->vScrollBar = GetNewControl(vScrollBarId,wr->theWindow);
  wr->hScrollBar = GetNewControl(hScrollBarId,wr->theWindow);

  /* set correct size of the scroll bars */
  MoveControl(wr->vScrollBar,r.right-15,-1);
  SizeControl(wr->vScrollBar,16,r.bottom-13);
  SetControlMinimum(wr->vScrollBar,0);
  SetControlMaximum(wr->vScrollBar,0);
  SetControlValue(wr->vScrollBar,0);
  ShowControl(wr->vScrollBar);
  MoveControl(wr->hScrollBar,-1,r.bottom-15);
  SizeControl(wr->hScrollBar,r.right-13,16);
  SetControlMinimum(wr->hScrollBar,0);
  SetControlMaximum(wr->hScrollBar,0);
  SetControlValue(wr->hScrollBar,0);
  ShowControl(wr->hScrollBar);
  DrawControls(wr->theWindow);

  SetRect(&(wr->usableRect),0,0,dh,dv);

  return(0);
}
/**
 *  Zeichenmethode.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 *
 *  @author OLiver
 */
bool ctrlScrollBar::Draw_()
{
    // Leiste
    Draw3D(GetX(), GetY() + button_height - 2, width_, height_ - button_height * 2 + 4, tc, 2);

    // Buttons
    DrawControls();

    // Scrollbar
    Draw3D(GetX(), GetY() + button_height + scrollbar_pos, width_, scrollbar_height, tc, 0);

    return true;
}
Beispiel #9
0
void DrawWindow(WindowRef window)
{
    GrafPtr		curPort;
	
    GetPort(&curPort);
    SetPort(GetWindowPort(window));
    BeginUpdate(window);

    DrawControls(window);
    DrawGrowIcon(window);
    EndUpdate(window);
    SetPort(curPort);
}
Beispiel #10
0
void palette_polygon_load(void)
{
	int						type,main_idx,poly_idx;
	float					x_txtoff,y_txtoff,x_txtfact,y_txtfact;
	map_mesh_type			*mesh;
	map_mesh_poly_type		*poly;
	map_liquid_type			*liq;
	
		// get polygon
		
	select_get(0,&type,&main_idx,&poly_idx);
	
	if (type==mesh_piece) {
		mesh=&map.mesh.meshes[main_idx];
		poly=&mesh->polys[poly_idx];

		map_mesh_get_poly_uv_as_box(&map,main_idx,poly_idx,&x_txtoff,&y_txtoff,&x_txtfact,&y_txtfact);
		
		dialog_set_float(palette_poly_wind,kMeshPolySettingOffX,0,x_txtoff);
		dialog_set_float(palette_poly_wind,kMeshPolySettingOffY,0,y_txtoff);
		dialog_set_float(palette_poly_wind,kMeshPolySettingSizeX,0,x_txtfact);
		dialog_set_float(palette_poly_wind,kMeshPolySettingSizeY,0,y_txtfact);
		
		dialog_set_float(palette_poly_wind,kMeshPolySettingAlpha,0,poly->alpha);
		dialog_set_float(palette_poly_wind,kMeshPolySettingDark,0,poly->dark_factor);
		dialog_set_float(palette_poly_wind,kMeshPolySettingShiftX,0,poly->x_shift);
		dialog_set_float(palette_poly_wind,kMeshPolySettingShiftY,0,poly->y_shift);
		
		dialog_special_combo_fill_node(palette_poly_wind,kMeshPolySettingCamera,0,poly->camera);
	}
	
		// liquid data
		
	else {
		liq=&map.liquid.liquids[main_idx];
		
		dialog_enable(palette_poly_wind,kMeshPolySettingDark,0,FALSE);
		dialog_enable(palette_poly_wind,kMeshPolySettingCamera,0,FALSE);
		
		dialog_set_float(palette_poly_wind,kMeshPolySettingOffX,0,liq->x_txtoff);
		dialog_set_float(palette_poly_wind,kMeshPolySettingOffY,0,liq->y_txtoff);
		dialog_set_float(palette_poly_wind,kMeshPolySettingSizeX,0,liq->x_txtfact);
		dialog_set_float(palette_poly_wind,kMeshPolySettingSizeY,0,liq->y_txtfact);

		dialog_set_float(palette_poly_wind,kMeshPolySettingAlpha,0,liq->alpha);
		dialog_set_float(palette_poly_wind,kMeshPolySettingShiftX,0,liq->x_shift);
		dialog_set_float(palette_poly_wind,kMeshPolySettingShiftY,0,liq->y_shift);
	}
	
	DrawControls(palette_poly_wind);
}
Beispiel #11
0
/**
 *  Zeichenmethode.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 */
bool ctrlScrollBar::Draw_()
{
    DrawPoint pos = GetDrawPos();
    // Leiste
    Draw3D(pos + DrawPoint(0, button_height - 2), width_, height_ - button_height * 2 + 4, tc, 2);

    // Buttons
    DrawControls();

    // Scrollbar
    Draw3D(pos + DrawPoint(0, button_height + scrollbar_pos), width_, scrollbar_height, tc, 0);

    return true;
}
Beispiel #12
0
void DrawWindow(WindowRef window)
{
    Rect		tempRect;
    GrafPtr		curPort;
	
    GetPort(&curPort);
    SetPort(GetWindowPort(window));
    BeginUpdate(window);
    EraseRect(GetWindowPortBounds(window, &tempRect));
    DrawControls(window);
    DrawGrowIcon(window);
    EndUpdate(window);
    SetPort(curPort);
}
Beispiel #13
0
/**
 *  Zeichenmethode
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 *
 *  @author OLiver
 */
bool ctrlTab::Draw_(void)
{
    DrawControls();

    LOADER.GetImageN("io", 3)->Draw(GetX() + tab_count * 36, GetY(), 0, 0, 0, 0, width - tab_count * 36, 45);

    Draw3D(GetX(), GetY() + 32, width, 13, TC_GREEN1, 0);

    ctrlButton* button = GetCtrl<ctrlButton>(tab_selection);
    if(button)
        button->Draw();

    return true;
}
Beispiel #14
0
/**
 *  Zeichenmethode.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 */
bool ctrlScrollBar::Draw_()
{
    RTTR_Assert(scroll_range > pagesize); // Don't show unneccessary scrollbars, otherwise invariants might be violated.
    if(scroll_height == 0)
        return true;
    DrawPoint pos = GetDrawPos();
    // Leiste
    Draw3D(pos + DrawPoint(0, button_height - 2), width_, height_ - button_height * 2 + 4, tc, 2);

    // Buttons
    DrawControls();

    // Scrollbar
    Draw3D(pos + DrawPoint(0, button_height + sliderPos), width_, sliderHeight, tc, 0);

    return true;
}
Beispiel #15
0
void palette_sound_load(void)
{
	int						type,main_idx,poly_idx;
	map_sound_type			*sound;
	
		// get sound
		
	select_get(0,&type,&main_idx,&poly_idx);
	sound=&map.sounds[main_idx];
	
		// get controls
		
	dialog_special_combo_fill_sound(palette_sound_wind,kSoundName,0,sound->name);
	dialog_set_float(palette_sound_wind,kSoundPitch,0,sound->pitch);
	dialog_set_boolean(palette_sound_wind,kSoundOn,0,sound->on);
	
	DrawControls(palette_sound_wind);
}
Beispiel #16
0
/**
 *  zeichnet das Fenster.
 */
bool ctrlMultiline::Draw_()
{
    if(draw_box)
        Draw3D(GetDrawPos(), width_, height_, tc, 2);

    DrawControls();

    unsigned show_lines = std::min(lines_in_control, unsigned(lines.size()));

    unsigned scrollbarPos = GetCtrl<ctrlScrollBar>(0)->GetPos();
    DrawPoint curPos = GetDrawPos() + DrawPoint(2, 2);
    for(unsigned i = 0; i < show_lines; ++i)
    {
        font->Draw(curPos, lines[i + scrollbarPos].str, format, lines[i + scrollbarPos].color);
        curPos.y += font->getHeight();
    }

    return true;
}
Beispiel #17
0
/**
 *  Zeichenmethode zum Zeichnen des Desktops
 *  und der ggf. enthaltenen Steuerelemente.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 *
 *  @author OLiver
 */
bool Desktop::Draw_()
{
    if(background)
    {
        /*
                short w,h;
                double sW,sH, s;
                sW = (double)VIDEODRIVER.GetScreenWidth() / background->getWidth();
                sH = (double)VIDEODRIVER.GetScreenHeight() / background->getHeight();
                s = (sW < sH ? sW : sH);
                w = (short)((double) background->getWidth() * s);
                h = (short)((double) background->getHeight() * s);
                background->Draw(0, 0, w, h, 0, 0, 0, 0);*/
        background->Draw(0, 0, VIDEODRIVER.GetScreenWidth(), VIDEODRIVER.GetScreenHeight(), 0, 0, 0, 0);
    }

    DrawControls();

    return true;
}
Beispiel #18
0
/**
 *  Zeichenmethode.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 */
bool ctrlProgress::Draw_()
{
    DrawPoint barPos = GetDrawPos() + padding;
    // Offset by button size
    barPos.x += height_;
    Draw3D(barPos, CalcBarWidth(), height_ - 2 * padding.y, tc, 2);

    // Buttons
    DrawControls();

    const DrawPoint innerPadding(4, 4);
    unsigned int percentage = position * 100 / maximum;
    unsigned int progress = (CalcBarWidth() - innerPadding.x * 2) * position / maximum;

    // Farbe herausfinden
    unsigned int color = 0xFFD70000;

    // Feste Farbe?
    if(force_color)
        color = force_color;
    else
    {
        // Farbe wählen je nachdem wie viel Prozent
        if(percentage >= 60)
            color = 0xFF71B63C;
        else if(percentage >= 30)
            color = 0xFFFFBF33;
        else if(percentage >= 20)
            color = 0xFFDB7428;
    }

    // Leiste
    DrawRectangle(barPos + innerPadding, progress, height_ - 2 * (innerPadding.y + padding.y), color);

    // Prozentzahlen zeichnen
    std::stringstream percent;
    percent << percentage << "%";
    SmallFont->Draw(GetDrawPos() + DrawPoint(width_, height_) / 2, percent.str(), glArchivItem_Font::DF_VCENTER | glArchivItem_Font::DF_CENTER, COLOR_YELLOW);

    return true;
}
Beispiel #19
0
void palette_node_load(void)
{
    int						type,main_idx,poly_idx;
    node_type				*node;

    // get node

    select_get(0,&type,&main_idx,&poly_idx);
    node=&map.nodes[main_idx];

    // get controls

    dialog_set_text(palette_node_wind,kNodeName,0,node->name);
    dialog_set_int(palette_node_wind,kNodeEventID,0,node->event_id);
    dialog_set_float(palette_node_wind,kNodeAngleX,0,node->ang.x);
    dialog_set_float(palette_node_wind,kNodeAngleY,0,node->ang.y);
    dialog_set_float(palette_node_wind,kNodeAngleZ,0,node->ang.z);
    dialog_set_boolean(palette_node_wind,kNodeFollowCamera,0,node->follow_camera);

    DrawControls(palette_node_wind);
}
Beispiel #20
0
void TrackbarActionProcPtr (ControlRef theControl, ControlPartCode partCode)
{
    CvTrackbar * trackbar = icvTrackbarByHandle (theControl);

    if (trackbar == NULL)
    {
        fprintf(stderr,"Error getting trackbar\n");
        return;
    }
    else
    {
        int pos = GetControl32BitValue (theControl);
        if ( trackbar->data )
            *trackbar->data = pos;
        if ( trackbar->notify )
            trackbar->notify(pos);
        else if ( trackbar->notify2 )
            trackbar->notify2(pos, trackbar->userdata);

        //--------YV---------------------------
        CFStringEncoding encoding = kCFStringEncodingASCII;
        CFAllocatorRef alloc_default = kCFAllocatorDefault;  // = NULL;

        char valueinchar[20];
        sprintf(valueinchar, " (%d)",  *trackbar->data);

        // create an empty CFMutableString
        CFIndex maxLength = 256;
        CFMutableStringRef cfstring = CFStringCreateMutable(alloc_default,maxLength);

        // append some c strings into it.
        CFStringAppendCString(cfstring,trackbar->name,encoding);
        CFStringAppendCString(cfstring,valueinchar,encoding);

        SetControlData(trackbar->label, kControlEntireControl,kControlStaticTextCFStringTag, sizeof(cfstring), &cfstring);
        DrawControls(trackbar->parent->window);
        //-----------------------------------------
    }
}
Beispiel #21
0
/**
 *  Zeichenmethode.
 *
 *  @return @p true bei Erfolg, @p false bei Fehler
 *
 *  @author Devil
 */
bool ctrlProgress::Draw_(void)
{
    Draw3D(GetX() + height_ - 2 + x_padding, GetY() + y_padding, width_ - (height_ * 2) + 4 - 2 * x_padding, height_ - 2 * y_padding, tc, 2);

    // Buttons
    DrawControls();

    unsigned int percentage = position * 100 / maximum;
    unsigned int progress = (width_ - height_ * 2 - 4 - 2 * x_padding) * position / maximum;

    // Farbe herausfinden
    unsigned int color = 0xFFFF0000;

    // Feste Farbe?
    if(force_color)
        color = force_color;
    else
    {
        // Farbe wählen je nachdem wie viel Prozent
        if(percentage >= 60)
            color = 0xFF00E000;
        else if(percentage >= 30)
            color = 0xFFFFFF00;
        else if(percentage >= 20)
            color = 0xFFFF8000;
    }

    // Leiste
    DrawRectangle(GetX() + height_ + 2 + x_padding, GetY() + 4 + y_padding, progress, height_ - 8 - 2 * y_padding, color);

    // Prozentzahlen zeichnen
    std::stringstream percent;
    percent << percentage << "%";
    SmallFont->Draw(GetX() + (width_ / 2), GetY() + height_ / 2, percent.str(), glArchivItem_Font::DF_VCENTER | glArchivItem_Font::DF_CENTER, COLOR_YELLOW);

    return true;
}
Beispiel #22
0
void shellupdatewindow (WindowPtr w) {
	
	/*
	1/17/91 dmb: draw scrollbars, buttons, etc. before window contents
	*/
	
	hdlwindowinfo hinfo;
	register hdlwindowinfo hw;
	
	getwindowinfo (w, &hinfo);
	
	hw = hinfo; /*copy into register*/
	
	if ((hinfo == nil) || (**hinfo).fldisposewhenpopped) {

		#ifdef MACVERSION
			BeginUpdate (w);
			
			EndUpdate (w);
		#endif
		
		return;
		}
	
	BeginUpdate (w);
	
	if (!shellpushglobals (w))
		goto exit;
	
	//Code change by Timothy Paustian Monday, August 21, 2000 4:31:49 PM
	//Must pass a CGrafPtr to pushport on OS X to avoid a crash
	{
	CGrafPtr	thePort;
	#if TARGET_API_MAC_CARBON == 1
	thePort = GetWindowPort(w);
	#else
	thePort = (CGrafPtr)w;
	#endif
		
	pushport (thePort);/*7/7/90 DW: this probably is not necessary, shellpushglobals does it*/
	}
#ifdef MACVERSION	
	if (!config.fldialog) /*if it's a dialog, the callback routine re-drew the controls*/
		DrawControls (w);
	
	if (config.flvertscroll)
		showscrollbar ((**hw).vertscrollbar); /*make sure it is visible*/
	
	shelldrawgrowicon (hw);
	
	if (config.flhorizscroll)
		showscrollbar ((**hw).horizscrollbar);
	//Code change by Timothy Paustian Saturday, April 29, 2000 11:07:46 PM
	//Changed to Opaque call for Carbon
	//This is working, but it is giving bact the coordinates in local not
	//global. It seems to make more sense to me so leave it.
	#if ACCESSOR_CALLS_ARE_FUNCTIONS == 1
	{
	CGrafPtr	thePort = GetWindowPort(w);
	(**hw).drawrgn = NewRgn(); //note we delete this below
	(**hw).drawrgn = GetPortVisibleRegion(thePort, (**hw).drawrgn);
	}
	#else
	//old code
	(**hw).drawrgn = (*w).visRgn; /*so updater knows what needs drawing*/
	#endif
#endif

#ifdef WIN95VERSION
//	(**hw).drawrgn = getvisregion (w);

	pushcliprgn ((**hw).drawrgn, false);
#endif

	if (shellrectneedsupdate (&(**hw).buttonsrect)) /*if window has an attached button list, draw it*/
		shelldrawbuttons ();
	
	drawwindowmessage (w);
	
	// 4.11.97 dmb: it appears that under Windows we need to push the clipk here.
	// Most likely, we should be establishing this wider clip soon arter window
	// creation, one time.

	if (shellrectneedsupdate (&(**hw).contentrect))
		(*shellglobals.updateroutine) ();
	
#ifdef WIN95VERSION
	popclip ();
	
	DeleteObject ((**hw).drawrgn);
#endif
#ifdef MACVERSION
	//Code change by Timothy Paustian Saturday, April 29, 2000 11:11:12 PM
	//Changed to Opaque call for Carbon
	//Get rid of the drawrgn to prevent a memory leak
	#if ACCESSOR_CALLS_ARE_FUNCTIONS == 1
	DisposeRgn((**hw).drawrgn);	
	#endif
#endif
	(**hw).drawrgn = nil; /*this is a temp, keep it nil normally*/
	
	popport (); /*7/7/90 DW: see comment for pusport, above*/
	
	shellpopglobals ();
	
	exit:
	
	EndUpdate (w);
	} /*shellupdatewindow*/
Beispiel #23
0
void DrawContents(void)
{
    PenNormal();
    DrawControls(GetPort());
}
Beispiel #24
0
void 	RchooseDialog::setDialogState(void)
{
int i,m;
MenuHandle menuH;
short menucount;
	short		item;	
	short		iType;
	Handle		iHandle;
	Rect 		iRect;	
	
	
switch (_which) {
	case DT_TiffFile:
		if (DataFile < 0) _which = 1;
		break;
	case DT_DTP51:
		if (DTP51 < 0) _which = 1;
		break;
	case DT_XriteDTP41:
		if (DTP41 < 0) _which = 1;
		break;
	case DT_TechkonCP300:
		if (TechkonCP300 < 0) _which = 1;
		break;
	case DT_TechkonSP820:
		if (TechkonSP820 < 0) _which = 1;
		break;
	case DT_TechkonTCRCP300:
		if (TechkonTCRCP300 < 0) _which = 1;
		break;
	case DT_TechkonTCRSP820:
		if (TechkonTCRSP820 < 0) _which = 1;
		break;
	case DT_GretagHand:
		if (GretagHand < 0) _which = 1;
		break;
	case DT_GretagTable:
		if (GretagTable < 0) _which = 1;
		break;
	case DT_Xrite408:
		if (XR408 < 0) _which = 1;
		break;
	}	
	

switch (_which) {
	case (DT_DataFile):
		Disable(dialogptr,PatchFormat);
		Disable(dialogptr,DevicePort);
		menuH = GetMenu(Table_menu);
		menucount = CountMItems(menuH);

		for( i = menucount; i > 0; i-- )
			DelMenuItem(menuH,i);
			
		_which_patch = 1;
		GetDItem (dialogptr, PatchFormat, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,_which_patch);
		DrawControls(dialogptr);
		break;
	case (DT_DTP51):
		Enable(dialogptr,PatchFormat);
		Enable(dialogptr,DevicePort);
		menuH = GetMenu(Table_menu);
		menucount = CountMItems(menuH);

		for( i = menucount; i > 0; i-- )
			DelMenuItem(menuH,i);
		
		m = 1;
		for (i=0; i<doc->patchset->filenum; i++)
			{
			if (doc->patchset->patches[i] != NULL)
				{
				if ( doc->patchset->patches[i]->patches.strips == 1) 
					{
					convert[m] = i;
					convert2[i] = m;
					InsMenuItem(menuH, doc->patchset->patchames[i], m++);
					}
				}
			}
			
		//_which_patch = 1;
		GetDItem (dialogptr, PatchFormat, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,convert2[_which_patch]);
		GetDItem (dialogptr, DevicePort, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,_which_port);
		DrawControls(dialogptr);
		break;
	case (DT_TiffFile):
		Enable(dialogptr,PatchFormat);
		Disable(dialogptr,DevicePort);
		
		menuH = GetMenu(Table_menu);
		menucount = CountMItems(menuH);

		for( i = menucount; i > 0; i-- )
			DelMenuItem(menuH,i);
		
		m = 1;
		for (i=0; i<doc->patchset->filenum; i++)
			{
			if (doc->patchset->patches[i] != NULL)
				{
				if (doc->patchset->patches[i]->patches.strips == 0) 
					{
					convert[m] = i;
					convert2[i] = m;
					InsMenuItem(menuH, doc->patchset->patchames[i], m++);
					}
				}
			}
		//_which_patch = 1;
		GetDItem (dialogptr, PatchFormat, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,convert2[_which_patch]);
		GetDItem (dialogptr, DevicePort, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,_which_port);
		DrawControls(dialogptr);
		break;
	case (DT_TechkonCP300):
	case (DT_TechkonSP820):
	case (DT_TechkonTCRCP300):
	case (DT_TechkonTCRSP820):
	case (DT_GretagHand):
	case (DT_GretagTable):
		Enable(dialogptr,PatchFormat);
		Enable(dialogptr,DevicePort);
		
		menuH = GetMenu(Table_menu);
		menucount = CountMItems(menuH);

		for( i = menucount; i > 0; i-- )
			DelMenuItem(menuH,i);
		
		m = 1;
		for (i=0; i<doc->patchset->filenum; i++)
			{
			if (doc->patchset->patches[i] != NULL)
				{
				if (doc->patchset->patches[i]->patches.strips == 0) 
					{
					convert[m] = i;
					convert2[i] = m;
					InsMenuItem(menuH, doc->patchset->patchames[i], m++);
					}
				}
			}
		//_which_patch = 1;
		GetDItem (dialogptr, PatchFormat, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,convert2[_which_patch]);
		GetDItem (dialogptr, DevicePort, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,_which_port);
		DrawControls(dialogptr);
		break;
	case (DT_Xrite408):
		Disable(dialogptr,PatchFormat);
		break;
	}
	
if ((!density) && (_which == DT_Xrite408)) Disable(dialogptr,1);
else Enable(dialogptr,1);	

}
Beispiel #25
0
/**
 *  Zeichenmethode.
 *
 *  @author OLiver
 */
bool ctrlOptionGroup::Draw_(void)
{
    DrawControls();

    return true;
}
Beispiel #26
0
        /* VARARGS ARGSUSED */
void
TclpPanic TCL_VARARGS_DEF(CONST char *, format)
{
    va_list varg;
    char msg[256];
    WindowRef macWinPtr, foundWinPtr;
    Rect macRect;
    Rect buttonRect = PANIC_BUTTON_RECT;
    Rect iconRect = PANIC_ICON_RECT;
    Rect textRect = PANIC_TEXT_RECT;
    ControlHandle okButtonHandle;
    EventRecord event;
    Handle stopIconHandle;
    int	part;
    Boolean done = false;

    va_start(varg, format);
    vsprintf(msg, format, varg);
    va_end(varg);

    /*
     * Put up an alert without using the Resource Manager (there may 
     * be no resources to load). Use the Window and Control Managers instead.
     * We want the window centered on the main monitor. The following 
     * should be tested with multiple monitors. Look and see if there is a way
     * not using qd.screenBits.
     */
 
    macRect.top = (qd.screenBits.bounds.top + qd.screenBits.bounds.bottom)
	/ 2 - (PANICHEIGHT / 2);
    macRect.bottom = (qd.screenBits.bounds.top + qd.screenBits.bounds.bottom)
	/ 2 + (PANICHEIGHT / 2);
    macRect.left = (qd.screenBits.bounds.left + qd.screenBits.bounds.right)
	/ 2 - (PANICWIDTH / 2);
    macRect.right = (qd.screenBits.bounds.left + qd.screenBits.bounds.right)
	/ 2 + (PANICWIDTH / 2);
    
    macWinPtr = NewWindow(NULL, &macRect, "\p", true, dBoxProc, (WindowRef) -1,
            false, 0);
    if (macWinPtr == NULL) {
	goto exitNow;
    }
    
    okButtonHandle = NewControl(macWinPtr, &buttonRect, "\pOK", true,
	    0, 0, 1, pushButProc, 0);
    if (okButtonHandle == NULL) {
	CloseWindow(macWinPtr);
	goto exitNow;
    }
    
    SelectWindow(macWinPtr);
    SetCursor(&qd.arrow);
    stopIconHandle = GetIcon(kStopIcon);
            
    while (!done) {
	if (WaitNextEvent(mDownMask | keyDownMask | updateMask,
		&event, 0, NULL)) {
	    switch(event.what) {
		case mouseDown:
		    part = FindWindow(event.where, &foundWinPtr);
    
		    if ((foundWinPtr != macWinPtr) || (part != inContent)) {
		    	SysBeep(1);
		    } else {
		    	SetPortWindowPort(macWinPtr);
		    	GlobalToLocal(&event.where);
		    	part = FindControl(event.where, macWinPtr,
				&okButtonHandle);
    	
			if ((kControlButtonPart == part) && 
				(TrackControl(okButtonHandle,
					event.where, NULL))) {
			    done = true;
			}
		    }
		    break;
		case keyDown:
		    switch (event.message & charCodeMask) {
			case ENTERCODE:
			case RETURNCODE:
			    HiliteControl(okButtonHandle, 1);
			    HiliteControl(okButtonHandle, 0);
			    done = true;
		    }
		    break;
		case updateEvt:   
		    SetPortWindowPort(macWinPtr);
		    TextFont(systemFont);
		    
		    BeginUpdate(macWinPtr);
		    if (stopIconHandle != NULL) {
			PlotIcon(&iconRect, stopIconHandle);
		    }
		    TETextBox(msg, strlen(msg), &textRect, teFlushDefault);
		    DrawControls(macWinPtr);
		    EndUpdate(macWinPtr);
	    }
	}
    }

    CloseWindow(macWinPtr);

  exitNow:
#ifdef TCL_DEBUG
    Debugger();
#else
    abort();
#endif
}
/**
 *  Zeichenmethode.
 *
 *  @author jh
 */
bool ctrlMultiSelectGroup::Draw_()
{
    DrawControls();

    return true;
}
Beispiel #28
0
bool IngameWindow::Draw_()
{
    if(isModal_)
    {
        SetActive(true);
        Close(false);
    }

    // Linkes oberes Teil
    glArchivItem_Bitmap* leftUpperImg = LOADER.GetImageN("resource", 36);
    leftUpperImg->Draw(pos_);
    // Rechtes oberes Teil
    glArchivItem_Bitmap* rightUpperImg = LOADER.GetImageN("resource", 37);
    rightUpperImg->Draw(pos_ + DrawPoint(width_ - rightUpperImg->getWidth(), 0));

    // Die beiden Buttons oben
    static const unsigned short ids[2][3] =
    {
        {47, 55, 50},
        {48, 56, 52}
    };

    // Titelleiste
    if(closeOnRightClick_ || !IsModal())
        LOADER.GetImageN("resource", ids[0][button_state[0]])->Draw(pos_);
    if(!IsModal())
        LOADER.GetImageN("resource", ids[1][button_state[1]])->Draw(pos_ + DrawPoint(width_ - 16, 0));


    // Breite berechnen
    unsigned title_width = width_ - leftUpperImg->getWidth() - rightUpperImg->getWidth();

    unsigned short title_index;
    if(active_)
        title_index = isMoving ? 44 : 43;
    else
        title_index = 42;

    glArchivItem_Bitmap& titleImg = *LOADER.GetImageN("resource", title_index);
    DrawPoint titleImgPos = pos_ + DrawPoint(leftUpperImg->getWidth(), 0);
    // Wieviel mal nebeneinanderzeichnen?
    unsigned short title_count = title_width / titleImg.getWidth();
    for(unsigned short i = 0; i < title_count; ++i)
    {
        titleImg.Draw(titleImgPos);
        titleImgPos.x += titleImg.getWidth();
    }

    // Rest zeichnen
    unsigned short rest = title_width % titleImg.getWidth();

    if(rest)
        titleImg.Draw(titleImgPos, rest, 0, 0, 0, rest, 0);

    // Text auf die Leiste
    NormalFont->Draw(pos_ + DrawPoint(width_, titleImg.getHeight()) / 2, title_, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_VCENTER, COLOR_YELLOW);

    if(!isMinimized_)
    {
        // Seitenleisten

        // Höhe
        glArchivItem_Bitmap* bottomBorderSideImg = LOADER.GetImageN("resource", 45);
        unsigned side_height = height_ - leftUpperImg->getHeight() - bottomBorderSideImg->getHeight();

        // Wieviel mal nebeneinanderzeichnen?
        glArchivItem_Bitmap* leftSideImg = LOADER.GetImageN("resource", 38);
        glArchivItem_Bitmap* rightSideImg = LOADER.GetImageN("resource", 39);
        title_count = side_height / leftSideImg->getHeight();
        DrawPoint leftImgPos = pos_ + DrawPoint(0, leftUpperImg->getHeight());
        DrawPoint rightImgPos = leftImgPos + DrawPoint(width_ - leftSideImg->getWidth(), 0);
        for(unsigned short i = 0; i < title_count; ++i)
        {
            leftSideImg->Draw(leftImgPos);
            rightSideImg->Draw(rightImgPos);
            rightImgPos.y = leftImgPos.y += leftSideImg->getHeight();    
        }

        // Rest zeichnen
        rest = side_height % leftSideImg->getHeight();

        if(rest)
        {
            leftSideImg->Draw(leftImgPos, 0, rest, 0, 0, 0, rest);
            rightSideImg->Draw(rightImgPos, 0, rest, 0, 0, 0, rest);
        }

        // Untere Leiste

        unsigned side_width = width_ - bottomBorderSideImg->getWidth() * 2;

        // Wieviel mal nebeneinanderzeichnen?
        glArchivItem_Bitmap* bottomBarImg = LOADER.GetImageN("resource", 40);
        title_count = side_width / bottomBarImg->getWidth();
        DrawPoint bottomImgPos = pos_ + DrawPoint(bottomBorderSideImg->getWidth(), GetIwBottomBoundary());
        for(unsigned short i = 0; i < title_count; ++i)
        {
            bottomBarImg->Draw(bottomImgPos);
            bottomImgPos.x += bottomBarImg->getWidth();
        }

        rest = side_width % bottomBarImg->getWidth();

        if(rest)
            bottomBarImg->Draw(bottomImgPos, rest, 0, 0, 0, rest, 0);

        // Clientbereich

        // überhaupt ne Clienttexture gewnscht?
        if(background)
            background->Draw(pos_ + contentOffset, GetIwWidth(), iwHeight, 0, 0, GetIwWidth(), iwHeight);

        // Msg_PaintBefore aufrufen vor den Controls
        Msg_PaintBefore();

        DrawControls();

        // Links und rechts unten die 2 kleinen Knäufe
        bottomBorderSideImg->Draw(pos_ + DrawPoint(0, height_ - bottomBorderSideImg->getHeight()));
        bottomBorderSideImg->Draw(pos_ + DrawPoint(width_ - bottomBorderSideImg->getWidth(), height_ - bottomBorderSideImg->getHeight()));
    }
    else
    {
        glArchivItem_Bitmap* bottomBorderSideImg = LOADER.GetImageN("resource", 45);
        glArchivItem_Bitmap* bottomBarImg = LOADER.GetImageN("resource", 40);
        unsigned side_width = width_ - bottomBorderSideImg->getWidth() * 2;
        title_count = side_width / bottomBarImg->getWidth();

        DrawPoint bottomImgPos = pos_ + DrawPoint(bottomBorderSideImg->getWidth(), 20);
        for(unsigned short i = 0; i < title_count; ++i)
        {
            bottomBarImg->Draw(bottomImgPos);
            bottomImgPos.x += bottomBarImg->getWidth();
        }

        rest = side_width % bottomBarImg->getWidth();

        if(rest)
            bottomBarImg->Draw(bottomImgPos, rest, 0, 0, 0, rest, 0);

        bottomBorderSideImg->Draw(pos_ + DrawPoint(0, bottomBorderSideImg->getHeight()));
        bottomBorderSideImg->Draw(pos_ + DrawPoint(width_ - bottomBorderSideImg->getWidth(), bottomBorderSideImg->getHeight()));
    }

    return true;
}
Beispiel #29
0
bool IngameWindow::Draw_()
{
    if(modal)
    {
        SetActive(true);
        Close(false);
    }

    // Linkes oberes Teil
    LOADER.GetImageN("resource", 36)->Draw(x, y, 0, 0, 0, 0, 0, 0);
    // Rechtes oberes Teil
    LOADER.GetImageN("resource", 37)->Draw(x + width - LOADER.GetImageN("resource", 37)->getWidth(), y, 0, 0, 0, 0, 0, 0);

    // Die beiden Buttons oben
    static const unsigned short ids[2][3] =
    {
        {47, 55, 50},
        {48, 56, 52}
    };

    // Titelleiste
    if(!modal)
        LOADER.GetImageN("resource", ids[0][button_state[0]])->Draw(x, y, 0, 0, 0, 0, 0, 0);

    LOADER.GetImageN("resource", ids[1][button_state[1]])->Draw(x + width - 16, y, 0, 0, 0, 0, 0, 0);


    // Breite berechnen
    unsigned title_width = width - LOADER.GetImageN("resource", 36)->getWidth() - LOADER.GetImageN("resource", 37)->getWidth();

    // Wieviel mal nebeneinanderzeichnen?
    unsigned short title_count = title_width / LOADER.GetImageN("resource", 43)->getWidth();

    unsigned short title_index = 42;
    if(active)
    {
        if(move)
            title_index = 44;
        else
            title_index = 43;
    }

    for(unsigned short i = 0; i < title_count; ++i)
        LOADER.GetImageN("resource", title_index)->Draw(x + LOADER.GetImageN("resource", 36)->getWidth() + i * LOADER.GetImageN("resource", title_index)->getWidth(), y, 0, 0, 0, 0, 0, 0);

    // Rest zeichnen
    unsigned short rest = title_width % LOADER.GetImageN("resource", title_index)->getWidth();

    if(rest)
        LOADER.GetImageN("resource", title_index)->Draw(x + LOADER.GetImageN("resource", 36)->getWidth() + title_count * LOADER.GetImageN("resource", title_index)->getWidth(), y, rest, 0, 0, 0, rest, 0);

    // Text auf die Leiste
    NormalFont->Draw( x + width / 2, y + LOADER.GetImageN("resource", 43)->getHeight() / 2, title, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_VCENTER, COLOR_YELLOW);

    if(!minimized)
    {
        // Seitenleisten

        // Höhe
        unsigned side_height = height - LOADER.GetImageN("resource", 36)->getHeight() - LOADER.GetImageN("resource", 45)->getHeight();

        // Wieviel mal nebeneinanderzeichnen?
        title_count = side_height / LOADER.GetImageN("resource", 38)->getHeight();

        for(unsigned short i = 0; i < title_count; ++i)
        {
            LOADER.GetImageN("resource", 38)->Draw(x, y + LOADER.GetImageN("resource", 36)->getHeight() + i * LOADER.GetImageN("resource", 38)->getHeight(), 0, 0, 0, 0, 0, 0);
            LOADER.GetImageN("resource", 39)->Draw(x + width - LOADER.GetImageN("resource", 38)->getWidth(), y + LOADER.GetImageN("resource", 36)->getHeight() + i * LOADER.GetImageN("resource", 38)->getHeight(), 0, 0, 0, 0, 0, 0);
            //LOADER.GetImageN("resource", 43)->Draw(x+width-LOADER.GetImageN("resource", 38)->getWidth(),y);
        }

        // Rest zeichnen
        rest = side_height % LOADER.GetImageN("resource", 38)->getHeight();

        if(rest)
        {
            LOADER.GetImageN("resource", 38)->Draw(x, y + height - rest - LOADER.GetImageN("resource", 45)->getHeight(), 0, rest, 0, 0, 0, rest);
            LOADER.GetImageN("resource", 39)->Draw(x + width - LOADER.GetImageN("resource", 38)->getWidth(), y + LOADER.GetImageN("resource", 36)->getHeight() + title_count * LOADER.GetImageN("resource", 38)->getHeight(), 0, rest, 0, 0, 0, rest);
        }

        // Untere Leiste

        unsigned side_width = width - LOADER.GetImageN("resource", 45)->getWidth() * 2;

        // Wieviel mal nebeneinanderzeichnen?
        title_count = side_width / LOADER.GetImageN("resource", 40)->getWidth();

        for(unsigned short i = 0; i < title_count; ++i)
            LOADER.GetImageN("resource", 40)->Draw(x + LOADER.GetImageN("resource", 45)->getWidth() + i * LOADER.GetImageN("resource", 40)->getWidth(), y + iwHeight - LOADER.GetImageN("resource", 40)->getHeight(), 0, 0, 0, 0, 0, 0);

        rest = side_width % LOADER.GetImageN("resource", 40)->getWidth();

        if(rest)
            LOADER.GetImageN("resource", 40)->Draw(x + LOADER.GetImageN("resource", 45)->getWidth() + title_count * LOADER.GetImageN("resource", 40)->getWidth(), y + iwHeight - LOADER.GetImageN("resource", 40)->getHeight(), rest, 0, 0, 0, rest, 0);

        // Clientbereich

        // überhaupt ne Clienttexture gewnscht?
        if(background)
        {
            // Bereich ausrechnen
            unsigned client_width = width - 20;
            unsigned client_height = iwHeight - 31;

            background->Draw(this->x + LOADER.GetImageN("resource", 38)->getWidth(), this->y + LOADER.GetImageN("resource", 36)->getHeight(), client_width, client_height, 0, 0, client_width, client_height);
        }

        // Links und rechts unten die 2 kleinen Knäufe
        LOADER.GetImageN("resource", 45)->Draw(x, y + iwHeight - LOADER.GetImageN("resource", 45)->getHeight(), 0, 0, 0, 0, 0, 0);
        LOADER.GetImageN("resource", 45)->Draw(x + width - LOADER.GetImageN("resource", 45)->getWidth(), y + iwHeight - LOADER.GetImageN("resource", 45)->getHeight(), 0, 0, 0, 0, 0, 0);

        // Msg_PaintBefore aufrufen vor den Controls
        Msg_PaintBefore();

        DrawControls();
    }
    else
    {
        unsigned side_width = width - LOADER.GetImageN("resource", 45)->getWidth() * 2;
        title_count = side_width / LOADER.GetImageN("resource", 40)->getWidth();

        for(unsigned short i = 0; i < title_count; ++i)
            LOADER.GetImageN("resource", 40)->Draw(x + LOADER.GetImageN("resource", 45)->getWidth() + i * LOADER.GetImageN("resource", 40)->getWidth(), y + 20, 0, 0, 0, 0, 0, 0);

        rest = side_width % LOADER.GetImageN("resource", 40)->getWidth();

        if(rest)
            LOADER.GetImageN("resource", 40)->Draw(x + LOADER.GetImageN("resource", 45)->getWidth() + title_count * LOADER.GetImageN("resource", 40)->getWidth(), y + 20, rest, 0, 0, 0, rest, 0);

        LOADER.GetImageN("resource", 45)->Draw(x, y + 16, 0, 0, 0, 0, 0, 0);
        LOADER.GetImageN("resource", 45)->Draw(x + width - 16, y + 16, 0, 0, 0, 0, 0, 0);
    }

    return true;
}
OSStatus
WindowDrawContent( WindowRef window )
{
    DrawControls( window );
    return TextViewDraw( window, kMyMLTEDataStructProperty );
}