您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ text_layer_get_layer函数代码示例

51自学网 2021-06-03 08:47:08
  C++
这篇教程C++ text_layer_get_layer函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中text_layer_get_layer函数的典型用法代码示例。如果您正苦于以下问题:C++ text_layer_get_layer函数的具体用法?C++ text_layer_get_layer怎么用?C++ text_layer_get_layer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了text_layer_get_layer函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: select_click_handler

static void select_click_handler(ClickRecognizerRef recognizer, void *context) {	if (!state.isRunning) {		state.score = 0;				reset_labels();				layer_set_hidden((Layer*) high_score_label, true);  		layer_add_child(window_get_root_layer(window), text_layer_get_layer(high_score_label));  				state.timeInterval = 1000;		state.isRunning = true;		state.buttonPushed = true;		state.direction = 0;    	state.timer = app_timer_register(state.timeInterval, timer_callback, NULL);    	    	static char buf[32];  		snprintf(buf, 32, "Score: %u", state.score);    	text_layer_set_text(score_label, buf);  }}
开发者ID:aradreed,项目名称:up-down,代码行数:21,


示例2: views_init_fitbit_steps_text_layer

void views_init_fitbit_steps_text_layer(Layer *parent_layer) {  static const int16_t LEFT = 0;  static const int16_t TOP = 8;  static const int16_t WIDTH = STEPS_LAYER_WIDTH;  static const int16_t HEIGHT = STEPS_LAYER_HEIGHT;  fitbit_steps_text_layer = text_layer_create(GRect(LEFT, TOP, WIDTH, HEIGHT));  GFont font = fonts_load_custom_font(    resource_get_handle(RESOURCE_ID_FONT_STEPS_32));  text_layer_set_text_color(fitbit_steps_text_layer, GColorBlack);  text_layer_set_text_alignment(fitbit_steps_text_layer, GTextAlignmentCenter);  text_layer_set_background_color(fitbit_steps_text_layer, GColorWhite);  text_layer_set_font(fitbit_steps_text_layer, font);  layer_add_child(parent_layer, text_layer_get_layer(fitbit_steps_text_layer));  text_layer_set_text(fitbit_steps_text_layer, "...");}
开发者ID:code1up,项目名称:pebblebit,代码行数:21,


示例3: main_window_load

static void main_window_load(Window *window) {  Layer *window_layer = window_get_root_layer(window);  GRect bounds = layer_get_bounds(window_layer);    app_message_open(inbox_size, outbox_size);  compass_service_subscribe(compass_heading_handler);  // We do this to account for the offset due to the status bar  // at the top of the app window.  GRect layer_frame_description = layer_get_frame(window_layer);  layer_frame_description.origin.x = 0;  layer_frame_description.origin.y = 0;  // Add some background content to help demonstrate transparency.  s_text_layer = text_layer_create(layer_frame_description);    text_layer_set_text(s_text_layer, "Point towards/nthe device");  layer_add_child(window_layer, text_layer_get_layer(s_text_layer));  s_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_POINT);  GPoint center = grect_center_point(&bounds);  GSize image_size = gbitmap_get_bounds(s_bitmap).size;  GRect image_frame = GRect(center.x, center.y, image_size.w, image_size.h);  image_frame.origin.x -= image_size.w / 2;  image_frame.origin.y -= image_size.h / 2 - 30;  // Use GCompOpOr to display the white portions of the image  s_layer = bitmap_layer_create(image_frame);  bitmap_layer_set_bitmap(s_layer, s_bitmap);  bitmap_layer_set_compositing_mode(s_layer, GCompOpSet);    text_layer_set_font(s_text_layer, fonts_get_system_font(FONT_KEY_ROBOTO_CONDENSED_21));	text_layer_set_text_alignment(s_text_layer, GTextAlignmentCenter);  layer_add_child(window_layer, bitmap_layer_get_layer(s_layer));    }
开发者ID:eariassoto,项目名称:PositionServicePlatform,代码行数:40,


示例4: data_handler

static void data_handler(AccelData *data, uint32_t num_samples) {    if(state == 4){    if( ((data[0].x + data[1].x)/2 ) > 200){      movedUp = true;    }    if(movedUp && ((data[0].x + data[1].x)/2 ) < -200 ){    if(reps == 0){      reps = repMax;      if(sets == 0){        vibes_double_pulse();        titleText = text_layer_create(GRect(0, 0, 144, 168));        text_layer_set_background_color(titleText, GColorClear);        text_layer_set_text_color(titleText, GColorBlack);        text_layer_set_font(titleText, fonts_get_system_font(FONT_KEY_BITHAM_30_BLACK));        text_layer_set_text_alignment(titleText, GTextAlignmentCenter);        layer_add_child(window_get_root_layer(myWindow), text_layer_get_layer(titleText));        text_layer_set_text(titleText, "Start");          state = 0;        general_gui_update();      }      else {      sets--;      //call delay              }    }    else {      reps--;      if(reps == 0)        vibes_long_pulse();      movedUp = false;      snprintf(repBuffer, sizeof(repBuffer), "Reps%d/n", reps );      on_play_gui();    }  }}  }
开发者ID:johneG7,项目名称:KineTECH,代码行数:40,


示例5: update_total

static void update_total(){     //char total_str[15];    char decimal_buffer[5];  total_amt = (float)dollars + (float)cents/100;  total_amt_without_tip = total_amt;  //APP_LOG(APP_LOG_LEVEL_DEBUG, "total amount double: %02u", (int)total_amt);  // get the total with the tip  total_amt = total_amt * (1 + (double)tip_percent/100);  total_amt = total_amt / people;    //APP_LOG(APP_LOG_LEVEL_DEBUG, "total amount with tip: %02u", (int)total_amt);  int whole_num = (int)total_amt / 1;  snprintf(buffer, 5, "%d", (int)whole_num);  strcat(buffer, ".");  //APP_LOG(APP_LOG_LEVEL_DEBUG, "buffer %s", buffer);  // take float, multiply by 100 to shift the decimals over two places, and then do a mod 100 to get teh two decimals places  int decimal_places = (int)(total_amt * 100) % 100;  //APP_LOG(APP_LOG_LEVEL_DEBUG, "decimal places %u", decimal_places);  // append the decimals to the buffer  snprintf(decimal_buffer, 5, "%d", (int)decimal_places);  //char decimal_buffer[5];  strcat(buffer, decimal_buffer);  //APP_LOG(APP_LOG_LEVEL_DEBUG, "final buffer %s", buffer);  text_layer_set_text(total_layer, buffer);  // tip amount -- same procedure as above  tip_amt = total_amt_without_tip * (double)tip_percent/100;  tip_amt = tip_amt / people;  int whole_num_tip = (int)tip_amt / 1;  char tip_decimal_buffer[5];  snprintf(tip_buffer, 5, "%d", (int)whole_num_tip);  strcat(tip_buffer,".");  int tip_decimal_places = (int)(tip_amt * 100) % 100;  snprintf(tip_decimal_buffer, 5, "%d", (int)tip_decimal_places);  strcat(tip_buffer, tip_decimal_buffer);  text_layer_set_text(tip_layer, tip_buffer);  layer_mark_dirty(text_layer_get_layer(tip_layer));  layer_mark_dirty(text_layer_get_layer(total_layer));  layer_mark_dirty(text_layer_get_layer(layer_array[0]));  layer_mark_dirty(text_layer_get_layer(layer_array[1]));  layer_mark_dirty(text_layer_get_layer(layer_array[2]));  layer_mark_dirty(text_layer_get_layer(layer_array[3]));}
开发者ID:Med116,项目名称:tippy,代码行数:47,


示例6: main_window_load

static void main_window_load(Window *window) {  // Get information about the Window  Layer *window_layer = window_get_root_layer(window);  GRect bounds = layer_get_bounds(window_layer);  s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BACKGROUND);  s_background_layer = bitmap_layer_create(bounds);  bitmap_layer_set_bitmap(s_background_layer, s_background_bitmap);  // Create the TextLayer with specific bounds  s_time_layer = text_layer_create(GRect(0, 110, bounds.size.w, 60));  // Improve the layout to be more like a watchface  text_layer_set_background_color(s_time_layer, GColorBlack);  text_layer_set_text_color(s_time_layer, GColorFolly);  s_time_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_BANGER_60));  text_layer_set_font(s_time_layer, s_time_font);  text_layer_set_text_alignment(s_time_layer, GTextAlignmentCenter);  layer_add_child(window_layer, bitmap_layer_get_layer(s_background_layer));  layer_add_child(window_layer, text_layer_get_layer(s_time_layer));}
开发者ID:katerberg,项目名称:pebble-tutorial-watchface,代码行数:22,


示例7: handle_init

void handle_init(void) {	// Create a window and text layer	window = window_create();	text_layer = text_layer_create(GRect(0, 0, 144, 154));		// Set the text, font, and text alignment	text_layer_set_text(text_layer, "Hi, I'm a Pebble!");	text_layer_set_font(text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD));	text_layer_set_text_alignment(text_layer, GTextAlignmentCenter);		// Add the text layer to the window	layer_add_child(window_get_root_layer(window), text_layer_get_layer(text_layer));	// Push the window	window_stack_push(window, true);		// App Logging!	APP_LOG(APP_LOG_LEVEL_DEBUG, "Just pushed a window!");		accel_tap_service_subscribe(accel_tap_handler);}
开发者ID:bafino,项目名称:TapTest,代码行数:22,


示例8: main_window_load

static void main_window_load(Window *window) {  s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_YG);  s_background_layer = bitmap_layer_create(GRect(0, -5, 144, 180));  bitmap_layer_set_bitmap(s_background_layer, s_background_bitmap);  layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(s_background_layer));     s_time_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_yg_42));    s_time_layer = text_layer_create(GRect(23, 19, 100, 200));  text_layer_set_overflow_mode(s_time_layer, GTextOverflowModeWordWrap);  text_layer_set_background_color(s_time_layer, GColorClear);  text_layer_set_text_color(s_time_layer, GColorBlack);  text_layer_set_text(s_time_layer, "00:00");  text_layer_set_font(s_time_layer, s_time_font);  text_layer_set_text_alignment(s_time_layer, GTextAlignmentCenter);  layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_time_layer));}
开发者ID:amanmomin,项目名称:YG,代码行数:22,


示例9: hexagon_set_legend

void hexagon_set_legend(t_hexagon *hexagon, const char *legend_text){        if( !hexagon->text )        return;        TextLayer *layer;    layer = text_layer_create(            GRect(                0,                HALF_SQRT_3 * 1.1 * hexagon->side_width,                 2*hexagon->side_width,                 HALF_SQRT_3 * 0.9 * hexagon->side_width));    text_layer_set_background_color(layer, GColorClear);    text_layer_set_text_color(layer, hexagon_get_border_color(hexagon));     text_layer_set_text(layer, legend_text);    text_layer_set_font(layer, fonts_get_system_font(FONT_KEY_GOTHIC_14));    text_layer_set_text_alignment(layer, GTextAlignmentCenter);  //  layer_set_hidden(text_layer_get_layer(layer), true);    layer_add_child(hexagon->layer, text_layer_get_layer(layer));    hexagon->legend = layer;}
开发者ID:minimaxwell,项目名称:pebble,代码行数:22,


示例10: webcam_window_load

static void webcam_window_load(Window *window) {	Layer *window_layer = window_get_root_layer(window);	GRect bounds = layer_get_bounds(window_layer);	image_layer = bitmap_layer_create(bounds);	bitmap_layer_set_alignment(image_layer, GAlignCenter);	layer_add_child(window_layer, bitmap_layer_get_layer(image_layer));	webcam_status_text_layer = text_layer_create(GRect(0, bounds.size.h - 16, bounds.size.w, 16));	text_layer_set_text(webcam_status_text_layer, "Please wait...");	text_layer_set_font(webcam_status_text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_14));	text_layer_set_text_alignment(webcam_status_text_layer, GTextAlignmentCenter);	text_layer_set_background_color(webcam_status_text_layer, GColorClear);	layer_add_child(window_layer, text_layer_get_layer(webcam_status_text_layer));	DictionaryIterator *iter;	app_message_outbox_begin(&iter);	dict_write_int(iter, KEY_WEBCAM, &webcam_current_id, sizeof(int), true);	dict_write_end(iter);	app_message_outbox_send();  }
开发者ID:ghys,项目名称:PebbleTrafficLux,代码行数:22,


示例11: window_load

static void window_load(Window *window) {  Layer *window_layer = window_get_root_layer(window);  GRect bounds = layer_get_bounds(window_layer);  const GEdgeInsets text_insets = {.top = 10};  s_text_layer = text_layer_create(grect_inset(bounds, text_insets));  text_layer_set_text_alignment(s_text_layer, GTextAlignmentCenter);  text_layer_set_overflow_mode(s_text_layer, GTextOverflowModeWordWrap);  text_layer_set_font(s_text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));  text_layer_set_text_color(s_text_layer, GColorWhite);  text_layer_set_background_color(s_text_layer, GColorClear);  text_layer_set_text(s_text_layer, "See the app logs to check the insert success./n/n Check the timeline after ~15s to see the pin!");  layer_add_child(window_layer, text_layer_get_layer(s_text_layer));#if defined(PBL_ROUND)  text_layer_enable_screen_text_flow_and_paging(s_text_layer, 3);#endif}static void window_unload(Window *window) {  text_layer_destroy(s_text_layer);}
开发者ID:tonym128,项目名称:pitter,代码行数:22,


示例12: init

// Handle the start-up of the appstatic void init(void) {  // Create our app's base window  window = window_create();  window_stack_push(window, true);  window_set_background_color(window, GColorBlack);  // Init the text layer used to show the time  // TODO: Wrap this boilerplate in a function?  timeLayer = text_layer_create(GRect(40, 54, 144-40 /* width */, 168-54 /* height */));  text_layer_set_text_color(timeLayer, GColorWhite);  text_layer_set_background_color(timeLayer, GColorClear);  text_layer_set_font(timeLayer, fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD));  // Ensures time is displayed immediately (will break if NULL tick event accessed).  // (This is why it's a good idea to have a separate routine to do the update itself.)  handle_minute_tick(NULL, 0);  layer_add_child(window_get_root_layer(window), text_layer_get_layer(timeLayer));  tick_timer_service_subscribe(MINUTE_UNIT, handle_minute_tick);}
开发者ID:43403901,项目名称:pebble-sdk-examples,代码行数:23,


示例13: status_bar_element_create

StatusBarElement* status_bar_element_create(Layer *parent) {  GRect bounds = element_get_bounds(parent);  int sm_text_margin = 2;  int y, height;  if (bounds.size.h <= ACTUAL_TEXT_HEIGHT_18 + PADDING_TOP_18 + PADDING_BOTTOM_18) {    // vertically center text if there is only room for one line    y = (bounds.size.h - ACTUAL_TEXT_HEIGHT_18) / 2 - PADDING_TOP_18;    height = ACTUAL_TEXT_HEIGHT_18 + PADDING_TOP_18 + PADDING_BOTTOM_18;  } else {    // otherwise take up all the space, with half the default padding    y = -1 * PADDING_TOP_18 / 2;    height = bounds.size.h - y;  }  TextLayer *text = text_layer_create(GRect(    sm_text_margin,    y,    bounds.size.w - sm_text_margin,    height  ));  text_layer_set_text_alignment(text, GTextAlignmentLeft);  text_layer_set_background_color(text, GColorClear);  text_layer_set_text_color(text, element_fg(parent));  text_layer_set_font(text, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));  text_layer_set_overflow_mode(text, GTextOverflowModeWordWrap);  layer_add_child(parent, text_layer_get_layer(text));  BatteryComponent *battery = NULL;  if (get_prefs()->battery_loc == BATTERY_LOC_STATUS_RIGHT) {    battery = battery_component_create(parent, bounds.size.w - battery_component_width() - battery_component_vertical_padding(), (bounds.size.h - battery_component_height()) / 2);  }  StatusBarElement *el = malloc(sizeof(StatusBarElement));  el->text = text;  el->battery = battery;  return el;}
开发者ID:oschumac,项目名称:urchin-cgm,代码行数:39,


示例14: window_load

/************************************ App *************************************/static void window_load(Window *window) {  Layer *window_layer = window_get_root_layer(window);  GRect bounds = layer_get_bounds(window_layer);    s_text_layer = text_layer_create(GRect(0, 0, bounds.size.w - 10, 2000));  text_layer_set_text_color(s_text_layer, GColorDarkGray);    changeText(0, FONT_KEY_GOTHIC_28_BOLD);  text_layer_set_text(s_text_layer, wikiData[0]);  layer_add_child(window_layer, text_layer_get_layer(s_text_layer));  // if height of quote > height of window, initiate animation to scroll  GSize text_size = text_layer_get_content_size(s_text_layer);  number_of_pixels = bounds.size.h - text_size.h;  printf("bound height: %d/n", bounds.size.h);  printf("text height: %d/n", text_size.h);  if (number_of_pixels < 0) {      printf("%s/n", "ANIMATION FOR DAYS");      animate_quote(number_of_pixels);  }    }
开发者ID:itstehkman,项目名称:PebbleWikiHow,代码行数:23,


示例15: window_load

static void window_load(Window *window) {  Layer *window_layer = window_get_root_layer(window);  GRect bounds = layer_get_bounds(window_layer);  s_scroll_layer = scroll_layer_create(bounds);  scroll_layer_set_click_config_onto_window(s_scroll_layer, window);  layer_add_child(window_layer, scroll_layer_get_layer(s_scroll_layer));  s_text_layer = text_layer_create(GRect(bounds.origin.x, bounds.origin.y, bounds.size.w, 2000));  text_layer_set_text(s_text_layer, s_long_text);  text_layer_set_text_alignment(s_text_layer, GTextAlignmentCenter);  text_layer_set_font(s_text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));  scroll_layer_add_child(s_scroll_layer, text_layer_get_layer(s_text_layer));  scroll_layer_set_content_size(s_scroll_layer, text_layer_get_content_size(s_text_layer));  // Must be after added to the view heirachy  text_layer_enable_screen_text_flow_and_paging(s_text_layer, 2);  // Enable ScrollLayer paging  scroll_layer_set_paging(s_scroll_layer, true);}
开发者ID:RodgerLeblanc,项目名称:text-flow-techniques,代码行数:22,


示例16: proj_stopped_note

voidproj_stopped_note(struct tm *tick_time, int p) {    int hours, mins, accum;    accum = proj_time[p] / 60;    hours = accum / 60;		/* hours */    mins = (accum - (hours * 60));	/* minutes */    app_log(APP_LOG_LEVEL_WARNING,	    __FILE__,	    __LINE__,	    "Proj[%d] Stopped: hours = %d, mins = %d",	    p, hours, mins);    if (proj_name[p] && *proj_name[p]) {	snprintf(string, sizeof(string),		 "%2u:%02u/n"		 "%s/n"		 "%s/n"		 "%2u:%02u",		 (uint)tick_time->tm_hour, (uint)tick_time->tm_min,		 proj_name[p],		 "stopped",		 (uint)hours, (uint)mins);    } else {	snprintf(string, sizeof(string),		 "%2u:%02u/n"		 "Proj %u/n"		 "%s/n"		 "%2u:%02u",		 (uint)tick_time->tm_hour, (uint)tick_time->tm_min,		 (uint)p,		 "stopped",		 (uint)hours, (uint)mins);    }    text_layer_set_text(text_layer, string);    layer_mark_dirty(text_layer_get_layer(text_layer));}
开发者ID:rajid,项目名称:pebble_tracker,代码行数:39,


示例17: copying_text_layer_create

CopyingTextLayer* copying_text_layer_create(GRect frame, const char* text, size_t max) {  CopyingTextLayer *copying_text_layer = (CopyingTextLayer *) malloc(sizeof(CopyingTextLayer));  *copying_text_layer = (CopyingTextLayer) {    .text_layer = text_layer_create(frame),    .text = copy_string(text, max),    .max_size = max,  };  text_layer_set_text(copying_text_layer->text_layer, copying_text_layer->text);  text_layer_set_background_color(copying_text_layer->text_layer, GColorClear);  text_layer_set_text_color(copying_text_layer->text_layer, GColorWhite);  return copying_text_layer;}Layer* copying_text_layer_get_layer(CopyingTextLayer *copying_text_layer) {  return text_layer_get_layer(copying_text_layer->text_layer);}void copying_text_layer_set_overflow(CopyingTextLayer *copying_text_layer, GTextOverflowMode overflow_mode) {  text_layer_set_overflow_mode(copying_text_layer->text_layer, overflow_mode);}
开发者ID:mcclellanmj,项目名称:PebbleWeatherFace,代码行数:22,


示例18: window_load

static void window_load(Window *window) {  Layer *window_layer = window_get_root_layer(window);  GRect bounds = layer_get_bounds(window_layer);  s_text_layer = text_layer_create(GRect(0, 55, bounds.size.w, 100));  text_layer_set_font(s_text_layer, fonts_get_system_font(FONT_KEY_LECO_38_BOLD_NUMBERS));  text_layer_set_text_alignment(s_text_layer, GTextAlignmentCenter);  text_layer_set_background_color(s_text_layer, GColorClear);  if (persist_read_int(KEY_BACKGROUND_COLOR)) {    int background_color = persist_read_int(KEY_BACKGROUND_COLOR);    set_background_and_text_color(background_color);  }  if (persist_read_bool(KEY_TWENTY_FOUR_HOUR_FORMAT)) {    twenty_four_hour_format = persist_read_bool(KEY_TWENTY_FOUR_HOUR_FORMAT);  }  layer_add_child(window_layer, text_layer_get_layer(s_text_layer));  update_time();}
开发者ID:GarrettGraham,项目名称:slate-watchface-template,代码行数:22,


示例19: load

static voidload(Window *window){  Layer *rl = window_get_root_layer(window);  user_data *ud;  Layer *l;  GRect f;  GSize s;   ud = (user_data*) malloc(sizeof(*ud));  if (!ud)    return;  *ud = (user_data) { .moving = {-1, -1} };  window_set_user_data(window, ud);    ud->icon = gbitmap_create_with_resource(RESOURCE_ID_MOVE);  ud->tl = text_layer_create(layer_get_bounds(rl));  text_layer_set_text(ud->tl, "Use FreeOTP on your mobile device to add tokens.");  text_layer_set_text_alignment(ud->tl, GTextAlignmentCenter);  text_layer_set_overflow_mode(ud->tl, GTextOverflowModeWordWrap);  s = text_layer_get_content_size(ud->tl);  l = text_layer_get_layer(ud->tl);  f = layer_get_frame(l);  f.origin.y = (f.size.h - s.h) / 2;  f.size.h = s.h;  layer_set_frame(l, f);  layer_set_hidden(l, true);    ud->ml = menu_layer_create(layer_get_bounds(rl));  layer_set_hidden(menu_layer_get_layer(ud->ml), false);  menu_layer_set_click_config_onto_window(ud->ml, window);  menu_layer_set_callbacks(ud->ml, ud, (MenuLayerCallbacks) {    .draw_row = menu_draw_row,    .get_num_rows = menu_get_num_rows,    .select_click = menu_select_click,    .select_long_click = menu_select_long_click,    .selection_changed = menu_selection_changed  });
开发者ID:biddyweb,项目名称:OTP2FA-Peeble,代码行数:39,


示例20: window_load

static void window_load(Window *window) {  Layer *window_layer = window_get_root_layer(window);  GRect bounds = layer_get_frame(window_layer);  GRect max_text_bounds = GRect(0, 0, bounds.size.w, 2000);  // Initialize the scroll layer  s_scroll_layer = scroll_layer_create(bounds);  // This binds the scroll layer to the window so that up and down map to scrolling  // You may use scroll_layer_set_callbacks to add or override interactivity  scroll_layer_set_click_config_onto_window(s_scroll_layer, window);  // Initialize the text layer  s_text_layer = text_layer_create(max_text_bounds);  text_layer_set_text(s_text_layer, s_scroll_text);  // Change the font to a nice readable one  // This is system font; you can inspect pebble_fonts.h for all system fonts  // or you can take a look at feature_custom_font to add your own font  text_layer_set_font(s_text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));  text_layer_set_background_color(s_text_layer, GColorClear);#if defined(PBL_PLATFORM_APLITE)  text_layer_set_text_color(s_text_layer, GColorBlack);#else  text_layer_set_text_color(s_text_layer, GColorWhite);#endif  // Trim text layer and scroll content to fit text box  GSize max_size = text_layer_get_content_size(s_text_layer);  text_layer_set_size(s_text_layer, max_size);  scroll_layer_set_content_size(s_scroll_layer, GSize(bounds.size.w, max_size.h + 4));  // Add the layers for display  scroll_layer_add_child(s_scroll_layer, text_layer_get_layer(s_text_layer));  layer_add_child(window_layer, scroll_layer_get_layer(s_scroll_layer)); }
开发者ID:stuntstein,项目名称:Pebble-rcTimer,代码行数:39,


示例21: main_window_load

/* ----------------  window load/unload---------------- */static void main_window_load(Window *window) {  // ウィンドウ情
C++ text_layer_init函数代码示例
C++ text_layer_destroy函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。