@sand, post #1
@sand, post #1
@Krashan, post #2
@sand, post #1
if (!gad) { DEBUG("Failed to create Tags gadget"); } if (!gad) goto cleanup;
if (!gad) { DEBUG("Failed to create Tags gadget"); goto cleanup; }
while ((msg = GT_GetIMsg(window->UserPort))) { switch(msg->Class) { ... } GT_ReplyIMsg(msg); }
while ((msg = GT_GetIMsg(window->UserPort))) { ULONG class = msg->Class; GT_ReplyIMsg(msg); switch(class) { ... } }
@sand, post #4
@docent, post #6
@Phibrizzo, post #3
@sand, post #8
@sand, post #12
UBYTE GUI_INTUITION_Create(void) { // get some helpers to create more compact window ULONG font_width = STARTER_pubscreen->RastPort.TxWidth; ULONG font_height = STARTER_pubscreen->RastPort.TxHeight; // ***************************************************************** // GADGETS setup // ***************************************************************** struct Gadget* g_context = CreateContext(&G_gadgets[GID_GADGETS_LIST]); struct NewGadget ng; // For all gadgets. ng.ng_TextAttr = STARTER_pubscreen->Font; ng.ng_VisualInfo = STARTER_visual_info; // -- LEFT COLUMN -- // create text ng.ng_LeftEdge = 10; ng.ng_TopEdge = font_height + 8; ng.ng_Width = font_width * 17; ng.ng_Height = font_height; ng.ng_Flags = 0; g_context = CreateGadget( TEXT_KIND, g_context, &ng, GTTX_Text, (ULONG)"Display mode:", TAG_END); // Create cycle/chooser ng.ng_LeftEdge = 10; ng.ng_TopEdge = font_height + 8 + font_height + 2; ng.ng_Width = font_width * 22; ng.ng_Height = font_height + 10; ng.ng_GadgetID = GID_MODE_CHOOSER; ng.ng_Flags = 0; G_gadgets[GID_MODE_CHOOSER] = g_context = CreateGadget( CYCLE_KIND, g_context, &ng, GTCY_Labels, (ULONG)G_mode_strings, GTCY_Active, (ULONG)G_mode_selection, TAG_END); // create text ng.ng_LeftEdge = 10; ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15; ng.ng_Width = font_width * 17; ng.ng_Height = font_height; ng.ng_Flags = 0; g_context = CreateGadget( TEXT_KIND, g_context, &ng, GTTX_Text, (ULONG)"Screen aspect:", TAG_END); // Create cycle/chooser ng.ng_LeftEdge = 10; ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2; ng.ng_Width = font_width * 22; ng.ng_Height = font_height + 10; ng.ng_GadgetID = GID_ASPECT_CHOOSER; ng.ng_Flags = 0; G_gadgets[GID_ASPECT_CHOOSER] = g_context = CreateGadget( CYCLE_KIND, g_context, &ng, GTCY_Labels, (ULONG)G_aspect_fullscreen_strings, GTCY_Active, (ULONG)0, TAG_END); // create text ng.ng_LeftEdge = 10; ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15; ng.ng_Width = font_width * 17; ng.ng_Height = font_height; ng.ng_Flags = 0; g_context = CreateGadget( TEXT_KIND, g_context, &ng, GTTX_Text, (ULONG)"Pixel format:", TAG_END); // Create cycle/chooser ng.ng_LeftEdge = 10; ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + 2; ng.ng_Width = font_width * 22; ng.ng_Height = font_height + 10; ng.ng_GadgetText = NULL; ng.ng_GadgetID = GID_PIXEL_CHOOSER; ng.ng_Flags = 0; G_gadgets[GID_PIXEL_CHOOSER] = g_context = CreateGadget( CYCLE_KIND, g_context, &ng, GTCY_Labels, (ULONG)G_pixel_strings, GTCY_Active, (ULONG)G_pixel_selection, TAG_END); // create text ng.ng_LeftEdge = 10; ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15; ng.ng_Width = font_width * 17; ng.ng_Height = font_height; ng.ng_GadgetText = NULL; ng.ng_Flags = 0; g_context = CreateGadget( TEXT_KIND, g_context, &ng, GTTX_Text, (ULONG)"Screen buffering:", TAG_END); // Create cycle/chooser ng.ng_LeftEdge = 10; ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + 2; ng.ng_Width = font_width * 22; ng.ng_Height = font_height + 10; ng.ng_GadgetText = NULL; ng.ng_GadgetID = GID_BUFFER_CHOOSER; ng.ng_Flags = 0; G_gadgets[GID_BUFFER_CHOOSER] = g_context = CreateGadget( CYCLE_KIND, g_context, &ng, GTCY_Labels, (ULONG)G_buffering_strings_3, GTCY_Active, (ULONG)2, TAG_END); // -- RIGHT COLUMN -- // create text ng.ng_LeftEdge = 10 + font_width * 22 + 10; ng.ng_TopEdge = font_height + 8; ng.ng_Width = font_width * 17; ng.ng_Height = font_height; ng.ng_GadgetText = NULL; ng.ng_Flags = 0; g_context = CreateGadget( TEXT_KIND, g_context, &ng, GTTX_Text, (ULONG)"Screen size:", TAG_END); // Create list view for screen modes. ng.ng_LeftEdge = 10 + font_width * 22 + 10; ng.ng_TopEdge = font_height + 8 + font_height + 2; ng.ng_Width = font_width * 24; ng.ng_Height = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + 8; ng.ng_GadgetText = NULL; ng.ng_GadgetID = GID_SCREEN_LIST; ng.ng_Flags = 0; G_gadgets[GID_SCREEN_LIST] = g_context = CreateGadget ( LISTVIEW_KIND, g_context, &ng, GTLV_ShowSelected, 0, GTLV_Selected, 0, GTLV_Labels, (ULONG)&G_screen_list, TAG_END); // -- BOTTOM ROW -- ULONG bottom_row_top_edge = font_height + 8 + font_height + 2 + font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + (font_height / 2); // Create help button. ng.ng_LeftEdge = 10; ng.ng_TopEdge = bottom_row_top_edge; ng.ng_Width = font_width * 14; ng.ng_Height = font_height + 12; ng.ng_GadgetText = (STRPTR)"HELP"; ng.ng_GadgetID = GID_HELP_BUTTON; ng.ng_Flags = 0; G_gadgets[GID_HELP_BUTTON] = g_context = CreateGadget(BUTTON_KIND, g_context, &ng, TAG_END); // Create start button. ng.ng_LeftEdge = 10 + font_width * 14 + 10; ng.ng_TopEdge = bottom_row_top_edge; ng.ng_Width = font_width * 32; ng.ng_Height = font_height + 12; ng.ng_GadgetText = (STRPTR)"START RAYCASTER"; ng.ng_GadgetID = GID_START_BUTTON; ng.ng_Flags = 0; G_gadgets[GID_START_BUTTON] = g_context = CreateGadget(BUTTON_KIND, g_context, &ng, TAG_END); // *********************************************************************** ULONG window_width = 15 + font_width * 22 + font_width * 24 + 15; ULONG window_height = bottom_row_top_edge + font_height + 12 + 5; ULONG window_pos_x = (STARTER_pubscreen->Width / 2) - (window_width / 2); ULONG window_pos_y = (STARTER_pubscreen->Height / 2) - (window_height / 2); // --- Create window --- STARTER_window = OpenWindowTags(NULL, WA_Left, window_pos_x, WA_Top, window_pos_y, WA_Width, window_width, WA_Height, window_height, WA_Title, (ULONG)STARTER_WINDOW_NAME, WA_Flags, WFLG_DRAGBAR | WFLG_DEPTHGADGET | WFLG_CLOSEGADGET | WFLG_ACTIVATE, WA_IDCMP, IDCMP_CLOSEWINDOW | IDCMP_REFRESHWINDOW | BUTTONIDCMP | LISTVIEWIDCMP | IDCMP_GADGETDOWN | IDCMP_GADGETUP, WA_Gadgets, (ULONG)G_gadgets[GID_GADGETS_LIST], TAG_END); // must be refreshed after creation - GT - for gaddets GT_RefreshWindow(STARTER_window, NULL); if (!STARTER_window) return 0; else return 1;
@mateusz_s, post #13
ng.ng_TopEdge = font_height + 8; .. ng.ng_TopEdge = font_height + 8 + font_height + 2; .. ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15; .. ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2; .. ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15; .. ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + 2; .. ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15; .. ng.ng_TopEdge = font_height + 8 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + 2 + font_height + 15 + font_height + 2; ...
ng.ng_TopEdge = font_height + 8; .. ng.ng_TopEdge += font_height + 2; .. ng.ng_TopEdge += font_height + 15; .. ng.ng_TopEdge += font_height + 2; .. ng.ng_TopEdge += font_height + 15; .. ng.ng_TopEdge += font_height + 2; .. ng.ng_TopEdge += font_height + 15; .. ng.ng_TopEdge += font_height + 2; ...
@mateusz_s, post #13
@Rafael/ARMO, post #14
@sand, post #16
@Ponki1986, post #17
@sand, post #18
@mateusz_s, post #19
@sand, post #18
@Ponki1986, post #23
@sand, post #24
Szkoda, ze nie mam ze soba maszyny z morphosem to bym zobaczył w czym jest problem.
@Ponki1986, post #26
@sand, post #29