• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GTK_CALENDAR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: gtk_dateentry_calendar_getfrom

/*
** store the calendar date to GDate, update our gtkentry
*/
static void gtk_dateentry_calendar_getfrom(GtkWidget * calendar, GtkDateEntry * dateentry)
{
guint year, month, day;

	DB( g_print(" (dateentry) get from calendar\n") );

	gtk_calendar_get_date (GTK_CALENDAR (dateentry->calendar), &year, &month, &day);
	g_date_set_dmy (dateentry->date, day, month + 1, year);
	gtk_dateentry_datetoentry(dateentry);
}
开发者ID:hdd,项目名称:homebank,代码行数:13,代码来源:gtkdateentry.c


示例2: update_calendar

static void
update_calendar (TpawCalendarButton *self)
{
  if (self->priv->calendar == NULL)
    return;

  gtk_calendar_clear_marks (GTK_CALENDAR (self->priv->calendar));

  if (self->priv->date == NULL)
    return;

  gtk_calendar_select_day (GTK_CALENDAR (self->priv->calendar),
      g_date_get_day (self->priv->date));
  gtk_calendar_select_month (GTK_CALENDAR (self->priv->calendar),
      g_date_get_month (self->priv->date) - 1,
      g_date_get_year (self->priv->date));
  gtk_calendar_mark_day (GTK_CALENDAR (self->priv->calendar),
      g_date_get_day (self->priv->date));
}
开发者ID:GNOME,项目名称:telepathy-account-widgets,代码行数:19,代码来源:tpaw-calendar-button.c


示例3: seahorse_gpgme_expires_new

void
seahorse_gpgme_expires_new (SeahorseGpgmeSubkey *subkey, GtkWindow *parent)
{
	SeahorseWidget *swidget;
	GtkWidget *date, *expire;
	gulong expires;
	gchar *title;
	const gchar *label;
	
	g_return_if_fail (subkey != NULL && SEAHORSE_IS_GPGME_SUBKEY (subkey));

	swidget = seahorse_widget_new_allow_multiple ("expires", parent);
	g_return_if_fail (swidget != NULL);
	g_object_set_data_full (G_OBJECT (swidget), "subkey", 
	                        g_object_ref (subkey), g_object_unref);
	
	date = GTK_WIDGET (seahorse_widget_get_widget (swidget, "calendar"));
	g_return_if_fail (date != NULL);

	expire = GTK_WIDGET (seahorse_widget_get_widget (swidget, "expire"));
	expires = seahorse_pgp_subkey_get_expires (SEAHORSE_PGP_SUBKEY (subkey)); 
	if (!expires) {
		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (expire), TRUE);
		gtk_widget_set_sensitive (date, FALSE);
	} else {
		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (expire), FALSE);
		gtk_widget_set_sensitive (date, TRUE);
	}
    
	if (expires) {
		struct tm t;
		time_t time = (time_t)expires;
		if (gmtime_r (&time, &t)) {
			gtk_calendar_select_month (GTK_CALENDAR (date), t.tm_mon, t.tm_year + 1900);
			gtk_calendar_select_day (GTK_CALENDAR (date), t.tm_mday);
		}
	}
	
	label = seahorse_pgp_subkey_get_description (SEAHORSE_PGP_SUBKEY (subkey));
	title = g_strdup_printf (_("Expiry: %s"), label);
	gtk_window_set_title (GTK_WINDOW (seahorse_widget_get_widget (swidget, swidget->name)), title);
	g_free (title);
}
开发者ID:nobled,项目名称:seahorse,代码行数:43,代码来源:seahorse-gpgme-expires.c


示例4: GetCalendar

static	void
GetCalendar(
	GtkWidget			*widget,
	_Calendar			*data)
{
ENTER_FUNC;
	gtk_calendar_get_date(GTK_CALENDAR(widget), 
		&(data->year),&(data->month),&(data->day));
LEAVE_FUNC;
}
开发者ID:authorNari,项目名称:panda,代码行数:10,代码来源:widgetOPS.c


示例5: on_calendar1_day_selected

void on_calendar1_day_selected( GtkWidget *widget, struct _properties *properties )
{
  g_print("on_calendar1_day_selected()\n");

  guint day, month, year;
  gtk_calendar_get_date (GTK_CALENDAR(properties->GtkInfo.calendar1), &year, &month, &day);

  int daysaway = date_to_days_away(day,month+1,year-2000);

  g_print("daysaway = %d, day = %d, month = %d, year = %d\n", daysaway, day, month, year);

  if(daysaway < 0)
  {
    properties->data.t[properties->calendarSelected] = 0;
    gtk_label_set_text(GTK_LABEL(properties->GtkInfo.labelCalendar),"Please select date greater than current");

  } else
  {
    time(&properties->starttime);

    int dummy;
    int hour;
    int minute;
    int seconds;

    switch(properties->calendarSelected)
    {
    case 0:
      decimal_date_to_real_dates(properties->data.t[properties->calendarSelected] - properties->data.te, &dummy, &dummy, &dummy, &hour, &minute, &seconds);
      break;

    case 1:
      decimal_date_to_real_dates(properties->data.t[properties->calendarSelected] - properties->data.te2, &dummy, &dummy, &dummy, &hour, &minute, &seconds);
      break;

    case 2:
      decimal_date_to_real_dates(properties->data.t[properties->calendarSelected] - properties->data.te3, &dummy, &dummy, &dummy, &hour, &minute, &seconds);
      break;

    default:
      g_print("on_calendar1_day_selected(): Bad calendarSelected switch\n");
      break;
    }

    properties->data.t[properties->calendarSelected] = adjust_to_current_time_forward( (double) --daysaway / (double) 365, 0.0 );

    double k = (double) (
                 ( (double)(hour)*(double)60*(double)60) +
                 (double)(minute*60) + (double)seconds);

    properties->data.t[properties->calendarSelected] += (double) ( (k) /(double)86400)/(double)365;
    gtk_label_set_text(GTK_LABEL(properties->GtkInfo.labelCalendar),"");
  }
}
开发者ID:mmizutani,项目名称:optionmatrix,代码行数:54,代码来源:gtk_calendar.cpp


示例6: selecionadata

void selecionadata(GtkWidget *widget,gpointer *entry){
gint ano,mes,dia;
char data[11];
gtk_calendar_get_date(GTK_CALENDAR(calendar),&ano,&mes,&dia);
mes ++;
//g_print("%d/%d/%d",dia,mes,ano);
//gtk_entry_set_text
sprintf(data,"%d/%d/%d",dia,mes,ano);
gtk_entry_set_text(GTK_ENTRY(entry),data);

}
开发者ID:uelei,项目名称:pbc,代码行数:11,代码来源:data.c


示例7: day_selected

static void
day_selected(GtkWidget *cal, calendar_data *cdata) {
	/* don't close it when the day change was caused by a month change! */
	if (!cdata->closehack) {
		guint *date = cdata->date;
		gtk_calendar_get_date(GTK_CALENDAR(cal), &date[0], &date[1], &date[2]);
		date[1]++; /* month was zero-based. */
		gtk_widget_destroy(cdata->win);
	}
	cdata->closehack = FALSE;
}
开发者ID:andy-shev,项目名称:LogJam,代码行数:11,代码来源:popcalendar.c


示例8: clip_GTK_CALENDARTHAW

/* Defrosts a calendar; all the changes made since
 * the last gtk_calendar_freeze() are displayed. */
int
clip_GTK_CALENDARTHAW(ClipMachine * ClipMachineMemory)
{
   C_widget *ccal = _fetch_cw_arg(ClipMachineMemory);

   CHECKCWID(ccal, GTK_IS_CALENDAR);
   gtk_calendar_thaw(GTK_CALENDAR(ccal->widget));
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:13,代码来源:calendar.c


示例9: calendar_day_selected_double_click

void calendar_day_selected_double_click( GtkWidget    *widget,
                                         CalendarData *data )
{
  struct tm tm;
  char buffer[256] = "day_selected_double_click: ";

  calendar_date_to_string (data, buffer+27, 256-27);
  calendar_set_signal_strings (buffer, data);

  memset (&tm, 0, sizeof (tm));
  gtk_calendar_get_date (GTK_CALENDAR(data->window),
			 &tm.tm_year, &tm.tm_mon, &tm.tm_mday);
  tm.tm_year -= TM_YEAR_BASE;

  if(GTK_CALENDAR(data->window)->marked_date[tm.tm_mday-1] == 0) {
    gtk_calendar_mark_day(GTK_CALENDAR(data->window),tm.tm_mday);
  } else { 
    gtk_calendar_unmark_day(GTK_CALENDAR(data->window),tm.tm_mday);
  }
}
开发者ID:omork,项目名称:mythryl,代码行数:20,代码来源:calendar.c


示例10: main

int main(int argc, char** argv)
{
    GtkWidget *window;
    GtkWidget *calendar;

    gtk_init(&argc, &argv);
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
    g_signal_connect(GTK_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);

    calendar = gtk_calendar_new();
    gtk_calendar_display_options(GTK_CALENDAR(calendar), GTK_CALENDAR_SHOW_HEADING|GTK_CALENDAR_SHOW_DAY_NAMES|
	    GTK_CALENDAR_SHOW_WEEK_NUMBERS|GTK_CALENDAR_WEEK_START_MONDAY);
    gtk_calendar_select_month(GTK_CALENDAR(calendar),8,1985);
    gtk_calendar_select_day(GTK_CALENDAR(calendar),8);
    gtk_container_add(GTK_CONTAINER(window), calendar);

    gtk_widget_show_all(window);
    gtk_main();
}
开发者ID:zhoujianchun,项目名称:gtk-pro,代码行数:20,代码来源:calendar_show_2.c


示例11: clip_GTK_CALENDARCLEARMARKS

int
clip_GTK_CALENDARCLEARMARKS(ClipMachine * ClipMachineMemory)
{
   C_widget *ccal = _fetch_cw_arg(ClipMachineMemory);

   CHECKCWID(ccal, GTK_IS_CALENDAR);
   gtk_calendar_clear_marks(GTK_CALENDAR(ccal->widget));
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:11,代码来源:calendar.c


示例12: create_simple_calendar_item

static GtkWidget* create_simple_calendar_item(GtkWidget** calendar_out)
{
    GtkWidget* menu_item = gtk_menu_item_new();
    GtkWidget* calendar = *calendar_out = gtk_calendar_new();
    gtk_calendar_set_display_options(GTK_CALENDAR(calendar),
                                     GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_NO_MONTH_CHANGE |
                                     GTK_CALENDAR_SHOW_DAY_NAMES | GTK_CALENDAR_SHOW_DETAILS);
    gtk_widget_set_sensitive(menu_item, FALSE);
    gtk_container_add(GTK_CONTAINER(menu_item), calendar);
    return menu_item;
}
开发者ID:Generator,项目名称:lightdm-another-gtk-greeter,代码行数:11,代码来源:indicator_clock.c


示例13: gtk_dialog_new_with_buttons

/**
 * a_dialog_get_date:
 *
 * Returns: a date as a string - always in ISO8601 format (YYYY-MM-DD)
 *  This string can be NULL (especially when the dialog is cancelled)
 *  Free the string after use
 */
gchar *a_dialog_get_date ( GtkWindow *parent, const gchar *title )
{
  GtkWidget *dialog = gtk_dialog_new_with_buttons ( title,
                                                    parent,
                                                    GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
                                                    GTK_STOCK_CANCEL,
                                                    GTK_RESPONSE_REJECT,
                                                    GTK_STOCK_OK,
                                                    GTK_RESPONSE_ACCEPT,
                                                    NULL);
  GtkWidget *cal = gtk_calendar_new ();
  GtkWidget *today = gtk_button_new_with_label ( _("Today") );

  static guint year = 0;
  static guint month = 0;
  static guint day = 0;

  if ( year != 0 ) {
    // restore the last selected date
    gtk_calendar_select_month ( GTK_CALENDAR(cal), month, year );
    gtk_calendar_select_day ( GTK_CALENDAR(cal), day );
  }

  gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), today, FALSE, FALSE, 0);
  gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), cal, FALSE, FALSE, 0);

  g_signal_connect_swapped ( G_OBJECT(today), "clicked", G_CALLBACK(today_clicked), cal );

  gtk_widget_show_all ( dialog );

  gtk_dialog_set_default_response ( GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT );

  gchar *date_str = NULL;
  if ( gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT )
  {
    gtk_calendar_get_date ( GTK_CALENDAR(cal), &year, &month, &day );
    date_str = g_strdup_printf ( "%d-%02d-%02d", year, month+1, day );
  }
  gtk_widget_destroy ( dialog );
  return date_str;
}
开发者ID:AurelienTT,项目名称:viking,代码行数:48,代码来源:dialog.c


示例14: calendar_set_flags

void calendar_set_flags( CalendarData *calendar )
{
  gint i;
  gint options=0;
  for (i=0;i<5;i++) 
    if (calendar->settings[i])
      {
	options=options + (1<<i);
      }
  if (calendar->window)
    gtk_calendar_display_options (GTK_CALENDAR (calendar->window), options);
}
开发者ID:omork,项目名称:mythryl,代码行数:12,代码来源:calendar.c


示例15: on_visibility_notify

static gboolean on_visibility_notify(GtkWidget* widget,
                                     GdkEvent* event,
                                     gpointer data)
{
    GDateTime* datetime = g_date_time_new_now_local();
    if(!datetime)
    {
        gtk_menu_item_set_label(GTK_MENU_ITEM(greeter.ui.clock.date_widget), "[date]");
        g_signal_handler_disconnect(greeter.ui.clock.date_widget, visibility_notify_id);
        return TRUE;
    }
    gchar* str = g_date_time_format(datetime, config.clock.date_format);
    gtk_menu_item_set_label(GTK_MENU_ITEM(greeter.ui.clock.date_widget), str);
    gtk_calendar_select_month(GTK_CALENDAR(greeter.ui.clock.calendar_widget),
                              g_date_time_get_month(datetime) - 1,
                              g_date_time_get_year(datetime));
    gtk_calendar_select_day(GTK_CALENDAR(greeter.ui.clock.calendar_widget), g_date_time_get_day_of_month(datetime));
    g_free(str);
    g_date_time_unref(datetime);
    return TRUE;
}
开发者ID:Generator,项目名称:lightdm-another-gtk-greeter,代码行数:21,代码来源:indicator_clock.c


示例16: clip_GTK_CALENDARGETDISPLAYOPTIONS

int
clip_GTK_CALENDARGETDISPLAYOPTIONS(ClipMachine * ClipMachineMemory)
{
   C_widget *ccal = _fetch_cw_arg(ClipMachineMemory);

   CHECKCWID(ccal, GTK_IS_CALENDAR);

   _clip_retni(ClipMachineMemory, gtk_calendar_get_display_options(GTK_CALENDAR(ccal->widget)));
   return 0;
 err:
   return 1;
}
开发者ID:amery,项目名称:clip-angelo,代码行数:12,代码来源:calendar.c


示例17: calendar_set_flags

static void
calendar_set_flags (CalendarData *calendar)
{
  gint options = 0, i;

  for (i = 0; i < G_N_ELEMENTS (calendar->settings); i++)
    if (calendar->settings[i])
      options=options + (1 << i);

  if (calendar->window)
    gtk_calendar_set_display_options (GTK_CALENDAR (calendar->window), options);
}
开发者ID:sam-m888,项目名称:gtk,代码行数:12,代码来源:testcalendar.c


示例18: gsb_calendar_update

/**
 * update the calendar of the scheduled transactions
 *
 * \param
 *
 * \return FALSE
 * */
gboolean gsb_calendar_update ( void )
{
    time_t temps;
    GSList *tmp_list;
    gint calendar_month;
	gint calendar_year;

    gtk_calendar_clear_marks ( GTK_CALENDAR ( scheduled_calendar ));

    /* select the current day */
    time ( &temps );

    if ( ( localtime ( &temps ) -> tm_mon == GTK_CALENDAR ( scheduled_calendar ) -> month )
	 &&
	 ( ( localtime ( &temps ) -> tm_year + 1900 ) == GTK_CALENDAR ( scheduled_calendar ) -> year ) )
	gtk_calendar_select_day ( GTK_CALENDAR ( scheduled_calendar ),
				  localtime ( &temps ) -> tm_mday );
    else
	gtk_calendar_select_day ( GTK_CALENDAR ( scheduled_calendar ),
				  FALSE );

    calendar_month = GTK_CALENDAR ( scheduled_calendar ) -> month + 1;
	calendar_year = GTK_CALENDAR ( scheduled_calendar ) -> year + 25;

    /* check the scheduled transactions and bold them in the calendar */
    tmp_list = gsb_data_scheduled_get_scheduled_list ();

    while ( tmp_list )
    {
	GDate *tmp_date;
	gint scheduled_number;

	scheduled_number = gsb_data_scheduled_get_scheduled_number (tmp_list -> data);

	tmp_date = gsb_date_copy (gsb_data_scheduled_get_date (scheduled_number));

	while (tmp_date && g_date_get_month (tmp_date) == calendar_month && g_date_get_year (tmp_date) < calendar_year)
	{
	    GDate *new_date;

	    gtk_calendar_mark_day ( GTK_CALENDAR ( scheduled_calendar ),
				    g_date_get_day (tmp_date));
	    new_date = gsb_scheduler_get_next_date (scheduled_number, tmp_date);
	    g_free (tmp_date);
	    tmp_date = new_date;
	}
	tmp_list = tmp_list -> next;
    }
    return FALSE;
}
开发者ID:philippedelorme,项目名称:grisbi,代码行数:57,代码来源:gsb_calendar.c


示例19: on_calendar_entry_activated

static void
on_calendar_entry_activated(GtkWidget *widget, GtkWidget *calendar)
{
    GDate *date;
    const gchar *text;

    date = g_date_new();

    text = gtk_entry_get_text(GTK_ENTRY(widget));
    g_date_set_parse(date, text);

    if (g_date_valid(date)) {
	gtk_calendar_freeze(GTK_CALENDAR(calendar));
	gtk_calendar_select_month(GTK_CALENDAR(calendar),
				  g_date_get_month(date) - 1,
				  g_date_get_year(date));
	gtk_calendar_select_day(GTK_CALENDAR(calendar),
				g_date_get_day(date));
	gtk_calendar_thaw(GTK_CALENDAR(calendar));
    }
    g_date_free(date);
}
开发者ID:BackupTheBerlios,项目名称:xfce-goodies-svn,代码行数:22,代码来源:datetime.c


示例20: calendar_date_to_string

void calendar_date_to_string( CalendarData *data,
			      char         *buffer,
			      gint          buff_len )
{
  struct tm tm;
  time_t time;

  memset (&tm, 0, sizeof (tm));
  gtk_calendar_get_date (GTK_CALENDAR(data->window),
			 &tm.tm_year, &tm.tm_mon, &tm.tm_mday);
  tm.tm_year -= TM_YEAR_BASE;
  time = mktime(&tm);
  strftime (buffer, buff_len-1, "%x", gmtime(&time));
}
开发者ID:omork,项目名称:mythryl,代码行数:14,代码来源:calendar.c



注:本文中的GTK_CALENDAR函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_CELL_RENDERER函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_BUTTON_BOX函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap