static void nmt_editor_section_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { NmtEditorSection *section = NMT_EDITOR_SECTION (object); NmtEditorSectionPrivate *priv = NMT_EDITOR_SECTION_GET_PRIVATE (section); switch (prop_id) { case PROP_TITLE: priv->title = g_value_dup_string (value); rebuild_header (section); break; case PROP_SHOW_BY_DEFAULT: priv->show_by_default = g_value_get_boolean (value); nmt_newt_toggle_button_set_active (NMT_NEWT_TOGGLE_BUTTON (priv->toggle), priv->show_by_default); break; case PROP_HEADER_WIDGET: priv->header_widget = g_value_get_object (value); if (priv->header_widget) g_object_ref_sink (priv->header_widget); rebuild_header (section); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
void playlist_view::move_header(bool redraw, bool update) { RECT rc_playlist, rc_header; GetClientRect(wnd_playlist, &rc_playlist); GetRelativeRect(wnd_header, wnd_playlist, &rc_header); int header_height = calculate_header_height(); if (rc_header.left != 0 - horizontal_offset || rc_header.top != 0 || rc_header.right - rc_header.left != rc_playlist.right - rc_playlist.left + horizontal_offset || rc_header.bottom - rc_header.top != header_height) { SendMessage(wnd_header, WM_SETREDRAW, FALSE, 0); if (rc_header.bottom - rc_header.top != header_height) { RECT playlist, redraw; get_playlist_rect(&playlist); ScrollWindowEx(wnd_playlist, 0, (header_height - rc_header.bottom), &playlist, &playlist, 0, &redraw, 0); // RedrawWindow(wnd_playlist,&redraw,0,RDW_INVALIDATE|RDW_UPDATENOW); } SetWindowPos(wnd_header, 0, 0 - horizontal_offset, 0, rc_playlist.right - rc_playlist.left + horizontal_offset, header_height, SWP_NOZORDER); if (cfg_nohscroll && update) rebuild_header(false); SendMessage(wnd_header, WM_SETREDRAW, TRUE, 0); if (redraw) RedrawWindow(wnd_header, 0, 0, RDW_UPDATENOW | RDW_INVALIDATE); } }
void playlist_view::create_header(bool visible) { if (wnd_header) { DestroyWindow(wnd_header); wnd_header = 0; } if (cfg_header) { wnd_header = CreateWindowEx(0, WC_HEADER, _T("Playlist display column titles"), WS_CHILD | (visible ? WS_VISIBLE : 0) | HDS_HOTTRACK | HDS_DRAGDROP | HDS_HORZ | (/*nohscroll ? 0 : */HDS_FULLDRAG) | (cfg_header_hottrack ? HDS_BUTTONS : 0), 0, 0, 0, 0, wnd_playlist, HMENU(5001), core_api::get_my_instance(), NULL); on_header_font_change(); rebuild_header(); } if (visible) RedrawWindow(wnd_playlist, 0, 0, RDW_INVALIDATE | RDW_UPDATENOW); }