[DEVELOPMENT ENVIRONMENT]
* BUG: The busy cursor is now correctly reset in all cases when clearing the recent file history. [GB.FORM] * BUG: The SidePanel.Border works correctly now. [GB.GTK] * BUG: Correctly handles mouse button events in the GridView control. * BUG: Setting GridView.Rows.Count to zero does not make rows too small anymore. git-svn-id: svn://localhost/gambas/trunk@1209 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
c9dd8bcefe
commit
2e3187b667
@ -338,32 +338,34 @@ PUBLIC SUB UpdateRecentMenu()
|
||||
mnuOpenRecent.Children.Clear
|
||||
mnuOpenRecent.Enabled = Project.GetRecentFiles().Count > 0
|
||||
|
||||
IF NOT mnuOpenRecent.Enabled THEN RETURN
|
||||
|
||||
hMenu = NEW Menu(mnuOpenRecent) AS "mnuClearRecent"
|
||||
hMenu.Text = ("&Clear history")
|
||||
hMenu.Picture = Picture["icon:/small/trash"]
|
||||
|
||||
bSort = Settings["/FWelcome/SortRecent", FALSE]
|
||||
|
||||
hMenu = NEW Menu(mnuOpenRecent) AS "mnuSortRecent"
|
||||
hMenu.Text = ("&Sort by path")
|
||||
hMenu.Toggle = TRUE
|
||||
Object.Lock(hMenu)
|
||||
hMenu.Checked = bSort
|
||||
Object.Unlock(hMenu)
|
||||
'hMenu.Picture = Picture["icon:/small/trash"]
|
||||
|
||||
aList = Project.GetRecentFiles(bSort)
|
||||
|
||||
hMenu = NEW Menu(mnuOpenRecent)
|
||||
|
||||
FOR EACH sPath IN aList
|
||||
hMenu = NEW Menu(mnuOpenRecent) AS "mnuOpenRecentFile"
|
||||
hMenu.Tag = sPath
|
||||
hMenu.Text = FormatFile(sPath)
|
||||
hMenu.Picture = Project.GetIcon(hMenu.Tag, 16)
|
||||
NEXT
|
||||
IF mnuOpenRecent.Enabled THEN
|
||||
|
||||
hMenu = NEW Menu(mnuOpenRecent) AS "mnuClearRecent"
|
||||
hMenu.Text = ("&Clear history")
|
||||
hMenu.Picture = Picture["icon:/small/trash"]
|
||||
|
||||
bSort = Settings["/FWelcome/SortRecent", FALSE]
|
||||
|
||||
hMenu = NEW Menu(mnuOpenRecent) AS "mnuSortRecent"
|
||||
hMenu.Text = ("&Sort by path")
|
||||
hMenu.Toggle = TRUE
|
||||
Object.Lock(hMenu)
|
||||
hMenu.Checked = bSort
|
||||
Object.Unlock(hMenu)
|
||||
'hMenu.Picture = Picture["icon:/small/trash"]
|
||||
|
||||
aList = Project.GetRecentFiles(bSort)
|
||||
|
||||
hMenu = NEW Menu(mnuOpenRecent)
|
||||
|
||||
FOR EACH sPath IN aList
|
||||
hMenu = NEW Menu(mnuOpenRecent) AS "mnuOpenRecentFile"
|
||||
hMenu.Tag = sPath
|
||||
hMenu.Text = FormatFile(sPath)
|
||||
hMenu.Picture = Project.GetIcon(hMenu.Tag, 16)
|
||||
NEXT
|
||||
|
||||
ENDIF
|
||||
|
||||
DEC Application.Busy
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.4 KiB |
@ -1,6 +1,6 @@
|
||||
# Gambas Project File 2.0
|
||||
Startup=FMain
|
||||
Version=2.3.1
|
||||
Version=2.4.1
|
||||
VersionProgram=gbx2 -V
|
||||
Library=gb.gui
|
||||
Library=gb.form
|
||||
|
@ -191,7 +191,7 @@ PRIVATE SUB RefreshPanel()
|
||||
|
||||
END
|
||||
|
||||
PUBLIC FUNCTION GetContainer() AS Container
|
||||
PUBLIC FUNCTION GetContainer() AS Panel
|
||||
|
||||
RETURN panSide
|
||||
|
||||
|
@ -16,9 +16,10 @@ SearchString=True
|
||||
|
||||
[OpenFile]
|
||||
File[1]="CGameField.class:0.0"
|
||||
Active=1
|
||||
File[2]="FMain.class:11.0"
|
||||
Count=2
|
||||
File[3]="FMain.form"
|
||||
Active=3
|
||||
Count=3
|
||||
|
||||
[Watches]
|
||||
Count=0
|
||||
|
@ -221,6 +221,7 @@ void gControl::initAll(gContainer *parent)
|
||||
_dirty_pos = _dirty_size = false;
|
||||
_tracking = false;
|
||||
no_input_method = false;
|
||||
_no_default_mouse_event = false;
|
||||
|
||||
onFinish=NULL;
|
||||
onFocusEvent=NULL;
|
||||
|
@ -170,6 +170,7 @@ public:
|
||||
|
||||
unsigned _no_delete : 1; // Do not delete on destroy signal
|
||||
unsigned no_input_method : 1; // No input method management
|
||||
unsigned _no_default_mouse_event : 1; // No default mouse events
|
||||
|
||||
|
||||
void removeParent() { pr = NULL; }
|
||||
|
@ -777,6 +777,7 @@ gGridView::gGridView(gContainer *parent) : gControl(parent)
|
||||
|
||||
render=new gTableRender(this);
|
||||
|
||||
_no_default_mouse_event = true;
|
||||
realize(true);
|
||||
|
||||
gtk_widget_add_events(border,GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
@ -815,9 +816,14 @@ gGridView::gGridView(gContainer *parent) : gControl(parent)
|
||||
|
||||
g_signal_connect_after(G_OBJECT(contents),"event",G_CALLBACK(cb_contents_button_press),this);
|
||||
g_signal_connect(G_OBJECT(contents),"motion-notify-event",G_CALLBACK(tblateral_move),this);
|
||||
|
||||
g_signal_connect(G_OBJECT(contents),"button-release-event",G_CALLBACK(gcb_button_release),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(contents),"button-press-event",G_CALLBACK(gcb_button_press),(gpointer)this);
|
||||
|
||||
g_signal_connect(G_OBJECT(contents),"button-press-event",G_CALLBACK(tblateral_press),this);
|
||||
g_signal_connect(G_OBJECT(contents),"button-release-event",G_CALLBACK(tblateral_release),this);
|
||||
|
||||
|
||||
//g_signal_connect(G_OBJECT(contents),"event",G_CALLBACK(gridview_release),this);
|
||||
|
||||
g_object_set(G_OBJECT(vbar),"visible",FALSE,(void *)NULL);
|
||||
@ -1273,15 +1279,18 @@ void gGridView::setRowCount(int vl)
|
||||
|
||||
render->setRowCount(vl);
|
||||
|
||||
h = minRowHeight(vl - 1);
|
||||
render->doNotInvalidate = true;
|
||||
for (i = old; i < vl; i++)
|
||||
if (vl)
|
||||
{
|
||||
//if ((i % 1000) == 0)
|
||||
// fprintf(stderr, "%d\r", i);
|
||||
setRowHeight(i, h);
|
||||
h = minRowHeight(vl - 1);
|
||||
render->doNotInvalidate = true;
|
||||
for (i = old; i < vl; i++)
|
||||
{
|
||||
//if ((i % 1000) == 0)
|
||||
// fprintf(stderr, "%d\r", i);
|
||||
setRowHeight(i, h);
|
||||
}
|
||||
render->doNotInvalidate = false;
|
||||
}
|
||||
render->doNotInvalidate = false;
|
||||
|
||||
unlock();
|
||||
|
||||
@ -1402,7 +1411,7 @@ void gGridView::setColumnWidth(int index,int vl)
|
||||
|
||||
int gGridView::minRowHeight(int index)
|
||||
{
|
||||
return 8 + font()->height(rowText(index));
|
||||
return 8 + font()->height(" "); // rowText(index)
|
||||
}
|
||||
|
||||
void gGridView::setRowHeight(int index,int vl)
|
||||
|
@ -163,7 +163,7 @@ gboolean gcb_keyrelease (GtkWidget *widget, GdkEventKey *event, gControl *data)
|
||||
return false;
|
||||
}
|
||||
|
||||
static gboolean sg_button_Press (GtkWidget *widget,GdkEventButton *event,gControl *data)
|
||||
gboolean gcb_button_press(GtkWidget *widget,GdkEventButton *event,gControl *data)
|
||||
{
|
||||
if (!gApplication::userEvents()) return false;
|
||||
|
||||
@ -214,7 +214,7 @@ static gboolean sg_menu(GtkWidget *widget, gControl *data)
|
||||
return false;
|
||||
}
|
||||
|
||||
static gboolean sg_button_Release (GtkWidget *widget,GdkEventButton *event,gControl *data)
|
||||
gboolean gcb_button_release(GtkWidget *widget,GdkEventButton *event,gControl *data)
|
||||
{
|
||||
if (!gApplication::userEvents()) return false;
|
||||
|
||||
@ -447,8 +447,11 @@ void gControl::widgetSignals()
|
||||
|
||||
if (border != widget && !GTK_IS_SCROLLED_WINDOW(border))
|
||||
{
|
||||
g_signal_connect(G_OBJECT(border),"button-release-event",G_CALLBACK(sg_button_Release),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(border),"button-press-event",G_CALLBACK(sg_button_Press),(gpointer)this);
|
||||
if (!_no_default_mouse_event)
|
||||
{
|
||||
g_signal_connect(G_OBJECT(border),"button-release-event",G_CALLBACK(gcb_button_release),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(border),"button-press-event",G_CALLBACK(gcb_button_press),(gpointer)this);
|
||||
}
|
||||
g_signal_connect(G_OBJECT(border),"popup-menu",G_CALLBACK(sg_menu),(gpointer)this);
|
||||
g_signal_connect_after(G_OBJECT(border),"motion-notify-event",G_CALLBACK(sg_motion),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(border),"scroll-event",G_CALLBACK(sg_scroll),(gpointer)this);
|
||||
@ -458,8 +461,11 @@ void gControl::widgetSignals()
|
||||
else
|
||||
{
|
||||
g_signal_connect(G_OBJECT(widget),"scroll-event",G_CALLBACK(sg_scroll),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(widget),"button-release-event",G_CALLBACK(sg_button_Release),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(widget),"button-press-event",G_CALLBACK(sg_button_Press),(gpointer)this);
|
||||
if (!_no_default_mouse_event)
|
||||
{
|
||||
g_signal_connect(G_OBJECT(widget),"button-release-event",G_CALLBACK(gcb_button_release),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(widget),"button-press-event",G_CALLBACK(gcb_button_press),(gpointer)this);
|
||||
}
|
||||
g_signal_connect(G_OBJECT(widget),"motion-notify-event",G_CALLBACK(sg_motion),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(widget),"popup-menu",G_CALLBACK(sg_menu),(gpointer)this);
|
||||
}
|
||||
|
@ -48,6 +48,8 @@ GtkStyle *gt_get_style(const char *name, int type);
|
||||
|
||||
gboolean gcb_keypress (GtkWidget *widget, GdkEventKey *event, gControl *data);
|
||||
gboolean gcb_keyrelease (GtkWidget *widget, GdkEventKey *event, gControl *data);
|
||||
gboolean gcb_button_press(GtkWidget *widget,GdkEventButton *event,gControl *data);
|
||||
gboolean gcb_button_release(GtkWidget *widget,GdkEventButton *event,gControl *data);
|
||||
|
||||
// Where to scroll to ensure that a specific area is visible
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user