mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-05 00:50:53 +00:00
add things
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@409 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -98,6 +98,13 @@ static void addr_up_activate(MwWidget handle, void* user, void* call) {
|
||||
free(p);
|
||||
}
|
||||
|
||||
static void addr_activate(MwWidget handle, void* user, void* call) {
|
||||
(void)user;
|
||||
(void)call;
|
||||
|
||||
scan(handle->parent, MwGetText(handle, MwNtext));
|
||||
}
|
||||
|
||||
static void layout(MwWidget handle) {
|
||||
filechooser_t* fc = handle->opaque;
|
||||
int w = MwGetInteger(handle, MwNwidth);
|
||||
@@ -147,6 +154,7 @@ static void layout(MwWidget handle) {
|
||||
wh = 24;
|
||||
if(fc->addr == NULL) {
|
||||
fc->addr = MwCreateWidget(MwEntryClass, "addr", handle, wx, wy, ww, wh);
|
||||
MwAddUserHandler(fc->addr, MwNactivateHandler, addr_activate, NULL);
|
||||
} else {
|
||||
MwVaApply(fc->addr,
|
||||
MwNx, wx,
|
||||
@@ -312,6 +320,8 @@ static void scan(MwWidget handle, const char* path) {
|
||||
MwDirectoryClose(dir);
|
||||
|
||||
qsort(fc->entries, arrlen(fc->entries), sizeof(MwDirectoryEntry*), qsort_files);
|
||||
} else {
|
||||
MwMessageBox(handle, "Directory does not exist!", "Error", MwMB_ICONERROR | MwMB_BUTTONOK);
|
||||
}
|
||||
|
||||
if(fc->path != NULL) free(fc->path);
|
||||
|
||||
@@ -100,6 +100,8 @@ static void key(MwWidget handle, int code) {
|
||||
} else if(code == MwLLKeyRight) {
|
||||
if(t->cursor == MwUTF8Length(str)) return;
|
||||
t->cursor++;
|
||||
} else if(code == MwLLKeyEnter) {
|
||||
MwDispatchUserHandler(handle, MwNactivateHandler, NULL);
|
||||
} else if(!(code & MwLLKeyMask)) {
|
||||
int incr = 0;
|
||||
out = malloc(strlen(str) + 5 + 1);
|
||||
|
||||
Reference in New Issue
Block a user