A small file manager(Raylib) lazarus / 74-Games ---------------------------------------------------------------------- Guva · 2025-04-03 16:34 An example of a file manager used by raylib. It also shows you how to download and display a language other than English. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program filebrowser;{$WARN 5044 off : Symbol "$1" is not portable}uses  SysUtils, Raylib, math; const  SCREEN_WIDTH = 800;  SCREEN_HEIGHT = 600;  FONT_SIZE = 20;  ITEM_HEIGHT = 30;  MAX_VISIBLE_ITEMS = 15;  MARGIN = 10;  SCROLL_SPEED = 1; var  Files: array of string;  ScrollOffset: Integer = 0;  SelectedItem: Integer = 0;  CurrentDir, ParentDir: string;  FileListArea: TRectangle;  RussianFont: TFont; // Функция для загрузки шрифта с поддержкой кириллицыfunction LoadRussianFont: TFont;var  i: Integer;  cp: array[0..511] of Integer;begin  // Инициализируем массив кодовых точек  for i := 0 to 95 do    cp[i] := 32 + i;  // Базовые ASCII символы   // Добавляем кириллические символы (диапазон 0x0400-0x04FF)  for i := 0 to 255 do  cp[96 + i] := $400 + i;   // Загружаем шрифт с указанными кодовыми точками  {$IFDEF UNIX}  Result := LoadFontEx('Yulong-Regular.otf', FONT_SIZE, @cp[0], Length(cp));  {$ELSE}  Result := LoadFontEx('C:\Windows\Fonts\arial.ttf', FONT_SIZE, @cp[0], Length(cp));  {$ENDIF}   if Result.texture.id = 0 then // Если шрифт не загрузился, используем стандартный    Result := GetFontDefault();end; procedure HandleMouseWheel;var  WheelMove: Single;begin  WheelMove := GetMouseWheelMove();   if WheelMove <> 0 then  begin    if WheelMove > 0 then      SelectedItem := Max(SelectedItem - SCROLL_SPEED, 0)    else if WheelMove < 0 then    SelectedItem := Min(SelectedItem + SCROLL_SPEED, High(Files));  end;end; function GetUserHomeDir: string;begin  {$IFDEF UNIX}  Result := GetEnvironmentVariable('HOME');  {$ELSE}  Result := GetEnvironmentVariable('USERPROFILE');  {$ENDIF}  if Result = '' then    Result := GetCurrentDir;end; procedure LoadDirectory(const Path: string);var  SearchRec: TSearchRec;  FileCount: Integer = 0;  IsDirectory: Boolean;begin  SetLength(Files, 0);   if Path <> ExtractFileDrive(Path) then  begin    SetLength(Files, 1);    Files[0] := '..' + PathDelim;    FileCount := 1;  end;   if FindFirst(IncludeTrailingPathDelimiter(Path) + '*', faDirectory, SearchRec) = 0 then  begin    repeat      IsDirectory := (SearchRec.Attr and faDirectory) <> 0;      if IsDirectory and (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then      begin      SetLength(Files, FileCount + 1);        Files[FileCount] := SearchRec.Name + PathDelim;        Inc(FileCount);      end;    until FindNext(SearchRec) <> 0;    FindClose(SearchRec);  end;   if FindFirst(IncludeTrailingPathDelimiter(Path) + '*', faAnyFile and not (faDirectory or faHidden), SearchRec) = 0 then  begin    repeat      IsDirectory := (SearchRec.Attr and faDirectory) <> 0;      if not IsDirectory then      begin        SetLength(Files, FileCount + 1);      Files[FileCount] := SearchRec.Name;        Inc(FileCount);      end;    until FindNext(SearchRec) <> 0;    FindClose(SearchRec);  end;   CurrentDir := IncludeTrailingPathDelimiter(Path);  ScrollOffset := 0;  SelectedItem := 0;end; procedure DrawInterface;var  i, YPos: Integer;  FileName: string;  MaxVisibleItems: Integer;  BGColor: TColor;begin  DrawTextEx(RussianFont, 'Файловый браузер',    Vector2Create(MARGIN, MARGIN), FONT_SIZE , 1, DARKGRAY);   // Текущая директория  DrawTextEx(RussianFont, PChar('Директория: ' + CurrentDir),    Vector2Create(MARGIN, MARGIN + 40), FONT_SIZE, 1, GRAY);   FileListArea := RectangleCreate(MARGIN, MARGIN + 80, SCREEN_WIDTH - 2*MARGIN, SCREEN_HEIGHT - 160);  // DrawRectangleRec(FileListArea, LIGHTGRAY);  DrawRectangleLinesEx(FileListArea, 1, GRAY);   MaxVisibleItems := Trunc(FileListArea.height / ITEM_HEIGHT);   if SelectedItem < ScrollOffset then    ScrollOffset := SelectedItem;  if SelectedItem >= ScrollOffset + MaxVisibleItems then    ScrollOffset := SelectedItem - MaxVisibleItems + 1;   for i := 0 to Min(MaxVisibleItems - 1, High(Files) - ScrollOffset) do  begin    YPos := Round(FileListArea.y) + i * ITEM_HEIGHT;    FileName := Files[ScrollOffset + i];     // Чередование цветов фона (как в Total Commander)    if (ScrollOffset + i) mod 2 = 0 then      BGColor := Fade(LIGHTGRAY, 0.5)    // Первый цвет фона    else      BGColor := Fade(LIGHTGRAY, 0.3) ;  // Второй цвет фона (светло-серый)   ;     if (ScrollOffset + i) = SelectedItem then    begin      DrawRectangle(Round(FileListArea.x), YPos, Round(FileListArea.width), ITEM_HEIGHT, BLUE);      if (FileName <> '') and (FileName[Length(FileName)] = PathDelim) then        DrawTextEx(RussianFont, PChar('['+ExcludeTrailingBackslash(FileName)+']'),          Vector2Create(Round(FileListArea.x) + 5, YPos + 5), FONT_SIZE, 1, WHITE)      else        DrawTextEx(RussianFont, PChar(FileName),        Vector2Create(Round(FileListArea.x) + 5, YPos + 5), FONT_SIZE, 1, WHITE)    end    else    begin      // Рисуем фон с чередующимся цветом      DrawRectangle(Round(FileListArea.x), YPos, Round(FileListArea.width), ITEM_HEIGHT, BGColor);       if (FileName <> '') and (FileName[Length(FileName)] = PathDelim) then      begin      if FileName = '..' + PathDelim then          DrawTextEx(RussianFont, PChar('['+ExcludeTrailingBackslash(FileName)+']'),            Vector2Create(Round(FileListArea.x) + 5, YPos + 5), FONT_SIZE, 1, DARKBLUE)        else          DrawTextEx(RussianFont, PChar('['+ExcludeTrailingBackslash(FileName)+']'),            Vector2Create(Round(FileListArea.x) + 5, YPos + 5), FONT_SIZE, 1, DARKGREEN);      end      else        DrawTextEx(RussianFont, PChar(FileName),          Vector2Create(Round(FileListArea.x) + 5, YPos + 5), FONT_SIZE, 1, DARKGRAY);    end;  end;   // Информация о файлах  if Length(Files) > 0 then    DrawTextEx(RussianFont, PChar(Format('%d/%d', [SelectedItem + 1, Length(Files)])),      Vector2Create(SCREEN_WIDTH - 50, SCREEN_HEIGHT - 30), FONT_SIZE, 1, LIGHTGRAY);   DrawTextEx(RussianFont, 'Стрелки:Навигация  Enter:Открыть  Backspace:Назад',    Vector2Create(MARGIN, SCREEN_HEIGHT - 30), FONT_SIZE , 1, GRAY);end; begin  InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, 'Файловый браузер');  SetTargetFPS(60);   // Загружаем шрифт с поддержкой кириллицы  RussianFont := LoadRussianFont;  SetTextureFilter(RussianFont.texture, TEXTURE_FILTER_TRILINEAR);   // Загрузка начальной директории  LoadDirectory(GetUserHomeDir);   while not WindowShouldClose do  begin    HandleMouseWheel;     if IsKeyPressed(KEY_DOWN) and (SelectedItem < High(Files)) then      Inc(SelectedItem);     if IsKeyPressed(KEY_UP) and (SelectedItem > 0) then      Dec(SelectedItem);     if IsKeyPressed(KEY_PAGE_DOWN) then      SelectedItem := Min(SelectedItem + MAX_VISIBLE_ITEMS, High(Files));   if IsKeyPressed(KEY_PAGE_UP) then      SelectedItem := Max(SelectedItem - MAX_VISIBLE_ITEMS, 0);     if IsKeyPressed(KEY_ENTER) and (Length(Files) > 0) then    begin      if (Files[SelectedItem] <> '') and (Files[SelectedItem][Length(Files[SelectedItem])] = PathDelim) then    begin        if Files[SelectedItem] = '..' + PathDelim then        begin          ParentDir := ExtractFileDir(ExcludeTrailingPathDelimiter(CurrentDir));          if ParentDir <> CurrentDir then            LoadDirectory(ParentDir);      end        else          LoadDirectory(CurrentDir + Files[SelectedItem]);      end      else        TraceLog(LOG_INFO, PChar('Selected: ' + CurrentDir + Files[SelectedItem]));    end;     if IsKeyPressed(KEY_BACKSPACE) then    begin      ParentDir := ExtractFileDir(ExcludeTrailingPathDelimiter(CurrentDir));      if ParentDir <> CurrentDir then        LoadDirectory(ParentDir);    end;     if IsKeyPressed(KEY_F5) then      LoadDirectory(CurrentDir);     BeginDrawing();      ClearBackground(RAYWHITE);      DrawInterface;    EndDrawing();  end;   // Освобождаем шрифт  UnloadFont(RussianFont);  CloseWindow;end.  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // Функция для загрузки шрифта с поддержкой множества языковfunction LoadUnicodeFont: TFont;var  cp: array of Integer;  i, count: Integer;   procedure AddRange(start, stop: Integer);  begin    while start <= stop do    begin      if count >= Length(cp) then        SetLength(cp, Length(cp) + 256);      cp[count] := start;      Inc(count);      Inc(start);    end;  end; begin  // Создаем массив кодовых точек  SetLength(cp, 4096);  count := 0;   // Базовые символы ASCII  AddRange(32, 126);   // Основные европейские языки  AddRange($C0, $17F);  // Latin-1 Supplement + Latin Extended-A  AddRange($180, $24F); // Latin Extended-B  AddRange($370, $3FF); // Greek and Coptic  AddRange($400, $4FF); // Cyrillic  AddRange($500, $52F); // Cyrillic Supplement  AddRange($1E00, $1EFF); // Latin Extended Additional   // Специальные символы для конкретных языков  // Африканские языки  AddRange($1E00, $1EFF); // Latin Extended Additional (Fon, Ewe и др.)  AddRange($2C60, $2C7F); // Latin Extended-C (Aja, Basaa)   // Азиатские языки (кириллица и латиница)  AddRange($A640, $A69F); // Cyrillic Extended-B (Kazakh, Chuvash)   // Дополнительные символы  AddRange($300, $36F);  // Combining Diacritical Marks  AddRange($1DC0, $1DFF); // Combining Diacritical Marks Supplement   // Уменьшаем массив до фактического размера  SetLength(cp, count);   // Пытаемся загрузить универсальный шрифт  {$IFDEF UNIX}  // Попробуем несколько шрифтов для Linux  Result := LoadFontEx('Yulong-Regular.otf', FONT_SIZE, @cp[0], Length(cp));  if Result.texture.id = 0 then    Result := LoadFontEx('/usr/share/fonts/truetype/freefont/FreeSans.ttf', FONT_SIZE, @cp[0], Length(cp));  {$ELSE}  // Для Windows используем Arial Unicode MS или обычный Arial  Result := LoadFontEx('C:\Windows\Fonts\arialuni.ttf', FONT_SIZE, @cp[0], Length(cp));  if Result.texture.id = 0 then    Result := LoadFontEx('C:\Windows\Fonts\arial.ttf', FONT_SIZE, @cp[0], Length(cp));  {$ENDIF}   if Result.texture.id = 0 then // Если шрифт не загрузился, используем стандартный    Result := GetFontDefault();end; ---------------------------------------------------------------------- Guva · 2025-04-04 03:32 implementation in c lang. I don't know why, but it might be useful to someone. Code: C  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #include #include #include #include #include #include #include  #define SCREEN_WIDTH 800#define SCREEN_HEIGHT 600#define FONT_SIZE 20#define ITEM_HEIGHT 30#define MAX_VISIBLE_ITEMS 15#define MARGIN 10#define SCROLL_SPEED 1 typedef struct {    char **items;    int count;} FileList; FileList files = {0};int scroll_offset = 0;int selected_item = 0;char current_dir[1024] = {0};char parent_dir[1024] = {0};Rectangle file_list_area;Font russian_font; // Функция для загрузки шрифта с поддержкой множества языковFont LoadUnicodeFont() {    int *codepoints = NULL;    int count = 0;    int capacity = 0;     // Функция для добавления диапазона символов    #define ADD_RANGE(start, end) \        for (int i = start; i <= end; i++) { \            if (count >= capacity) { \                capacity = (capacity == 0) ? 256 : capacity * 2; \                codepoints = realloc(codepoints, capacity * sizeof(int)); \            } \          codepoints[count++] = i; \        }     // Базовые символы ASCII    ADD_RANGE(32, 126);     // Основные европейские языки    ADD_RANGE(0xC0, 0x17F);  // Latin-1 Supplement + Latin Extended-A    ADD_RANGE(0x180, 0x24F); // Latin Extended-B    ADD_RANGE(0x370, 0x3FF); // Greek and Coptic    ADD_RANGE(0x400, 0x4FF); // Cyrillic  ADD_RANGE(0x500, 0x52F); // Cyrillic Supplement    ADD_RANGE(0x1E00, 0x1EFF); // Latin Extended Additional     // Специальные символы для конкретных языков    ADD_RANGE(0x1E00, 0x1EFF); // Latin Extended Additional (Fon, Ewe и др.)    ADD_RANGE(0x2C60, 0x2C7F); // Latin Extended-C (Aja, Basaa)     // Азиатские языки (кириллица и латиница)    ADD_RANGE(0xA640, 0xA69F); // Cyrillic Extended-B (Kazakh, Chuvash)     // Дополнительные символы    ADD_RANGE(0x300, 0x36F);  // Combining Diacritical Marks    ADD_RANGE(0x1DC0, 0x1DFF); // Combining Diacritical Marks Supplement     #undef ADD_RANGE     Font font = {0};     // Пытаемся загрузить универсальный шрифт    #ifdef __linux__    font = LoadFontEx("Yulong-Regular.otf", FONT_SIZE, codepoints, count);    if (font.texture.id == 0) {        font = LoadFontEx("/usr/share/fonts/truetype/freefont/FreeSans.ttf", FONT_SIZE, codepoints, count);    }    #else    font = LoadFontEx("C:\\Windows\\Fonts\\arialuni.ttf", FONT_SIZE, codepoints, count);    if (font.texture.id == 0) {        font = LoadFontEx("C:\\Windows\\Fonts\\arial.ttf", FONT_SIZE, codepoints, count);    }    #endif     free(codepoints);     if (font.texture.id == 0) {        font = GetFontDefault();    }     return font;} void HandleMouseWheel() {    float wheel_move = GetMouseWheelMove();     if (wheel_move != 0) {        if (wheel_move > 0) {            selected_item = (selected_item - SCROLL_SPEED > 0) ? selected_item - SCROLL_SPEED : 0;        } else if (wheel_move < 0) {            selected_item = (selected_item + SCROLL_SPEED < files.count - 1) ? selected_item + SCROLL_SPEED : files.count - 1;        }    }} const char* GetUserHomeDir() {    const char *home = getenv("HOME");    if (home == NULL) {        home = getenv("USERPROFILE");    }    if (home == NULL) {        home = ".";    }    return home;} void FreeFileList() {    for (int i = 0; i < files.count; i++) {        free(files.items[i]);    }    free(files.items);    files.items = NULL;    files.count = 0;} void LoadDirectory(const char *path) {    FreeFileList();     // Сохраняем текущую директорию    strncpy(current_dir, path, sizeof(current_dir) - 1);    current_dir[sizeof(current_dir) - 1] = '\0';     // Добавляем родительскую директорию, если это не корень    if (strcmp(path, "/") != 0 && strcmp(path, "C:\\") != 0) {        files.items = malloc(sizeof(char*));        files.items[0] = strdup("../");        files.count = 1;    }     DIR *dir = opendir(path);    if (dir != NULL) {        struct dirent *entry;        while ((entry = readdir(dir)) != NULL) {            // Пропускаем специальные директории            if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) {                continue;          }             // Проверяем, является ли это директорией            char full_path[1024];            snprintf(full_path, sizeof(full_path), "%s/%s", path, entry->d_name);             struct stat statbuf;            if (stat(full_path, &statbuf) == 0) {              if (S_ISDIR(statbuf.st_mode)) {                    // Это директория                    char *item = malloc(strlen(entry->d_name) + 2);                    sprintf(item, "%s/", entry->d_name);                    files.items = realloc(files.items, (files.count + 1) * sizeof(char*));                  files.items[files.count++] = item;                }            }        }        closedir(dir);    }     // Теперь добавляем файлы    dir = opendir(path);    if (dir != NULL) {        struct dirent *entry;        while ((entry = readdir(dir)) != NULL) {            // Пропускаем специальные директории            if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) {                continue;            }             // Проверяем, является ли это файлом            char full_path[1024];            snprintf(full_path, sizeof(full_path), "%s/%s", path, entry->d_name);             struct stat statbuf;            if (stat(full_path, &statbuf) == 0) {              if (!S_ISDIR(statbuf.st_mode)) {                    // Это файл                    files.items = realloc(files.items, (files.count + 1) * sizeof(char*));                    files.items[files.count++] = strdup(entry->d_name);                }          }        }        closedir(dir);    }     scroll_offset = 0;    selected_item = 0;} void DrawInterface() {    // Заголовок    DrawTextEx(russian_font, "Файловый браузер", (Vector2){MARGIN, MARGIN}, FONT_SIZE, 1, DARKGRAY);     // Текущая директория    char dir_text[2048];    snprintf(dir_text, sizeof(dir_text), "Директория: %s", current_dir);    DrawTextEx(russian_font, dir_text, (Vector2){MARGIN, MARGIN + 40}, FONT_SIZE, 1, GRAY);     // Область списка файлов    file_list_area = (Rectangle){MARGIN, MARGIN + 80, SCREEN_WIDTH - 2*MARGIN, SCREEN_HEIGHT - 160};    DrawRectangleLinesEx(file_list_area, 1, GRAY);     int max_visible_items = (int)(file_list_area.height / ITEM_HEIGHT);     // Корректируем scroll offset    if (selected_item < scroll_offset) {      scroll_offset = selected_item;    }    if (selected_item >= scroll_offset + max_visible_items) {        scroll_offset = selected_item - max_visible_items + 1;    }     // Рисуем видимые элементы    for (int i = 0; i < max_visible_items && (scroll_offset + i) < files.count; i++) {        int y_pos = (int)file_list_area.y + i * ITEM_HEIGHT;        const char *filename = files.items[scroll_offset + i];         // Чередование цветов фона        Color bg_color = ((scroll_offset + i) % 2 == 0) ?            Fade(LIGHTGRAY, 0.5f) : Fade(LIGHTGRAY, 0.3f);         if ((scroll_offset + i) == selected_item) {            // Выбранный элемент            DrawRectangle((int)file_list_area.x, y_pos, (int)file_list_area.width, ITEM_HEIGHT, BLUE);             char display_text[1024];            if (filename[strlen(filename)-1] == '/') {                if (strcmp(filename, "../") == 0) {                    snprintf(display_text, sizeof(display_text), "[..]");                } else {                    snprintf(display_text, sizeof(display_text), "[%.*s]", (int)strlen(filename)-1, filename);                }              DrawTextEx(russian_font, display_text, (Vector2){(int)file_list_area.x + 5, y_pos + 5}, FONT_SIZE, 1, WHITE);            } else {                DrawTextEx(russian_font, filename, (Vector2){(int)file_list_area.x + 5, y_pos + 5}, FONT_SIZE, 1, WHITE);            }        } else {            // Невыбранный элемент            DrawRectangle((int)file_list_area.x, y_pos, (int)file_list_area.width, ITEM_HEIGHT, bg_color);             char display_text[1024];            if (filename[strlen(filename)-1] == '/') {                if (strcmp(filename, "../") == 0) {                  snprintf(display_text, sizeof(display_text), "[..]");                  DrawTextEx(russian_font, display_text, (Vector2){(int)file_list_area.x + 5, y_pos + 5}, FONT_SIZE, 1, DARKBLUE);                } else {                    snprintf(display_text, sizeof(display_text), "[%.*s]", (int)strlen(filename)-1, filename);                    DrawTextEx(russian_font, display_text, (Vector2){(int)file_list_area.x + 5, y_pos + 5}, FONT_SIZE, 1, DARKGREEN);                }          } else {                DrawTextEx(russian_font, filename, (Vector2){(int)file_list_area.x + 5, y_pos + 5}, FONT_SIZE, 1, DARKGRAY);            }        }    }     // Информация о файлах    if (files.count > 0) {        char file_info[64];        snprintf(file_info, sizeof(file_info), "%d/%d", selected_item + 1, files.count);        DrawTextEx(russian_font, file_info, (Vector2){SCREEN_WIDTH - 50, SCREEN_HEIGHT - 30}, FONT_SIZE, 1, LIGHTGRAY);    }     // Подсказки    DrawTextEx(russian_font, "Стрелки:Навигация  Enter:Открыть  Backspace:Назад",        (Vector2){MARGIN, SCREEN_HEIGHT - 30}, FONT_SIZE, 1, GRAY);} int main() {    InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "Файловый браузер");    SetTargetFPS(60);     // Загружаем шрифт с поддержкой кириллицы    russian_font = LoadUnicodeFont();    SetTextureFilter(russian_font.texture, TEXTURE_FILTER_TRILINEAR);     // Загрузка начальной директории    LoadDirectory(GetUserHomeDir());     while (!WindowShouldClose()) {        HandleMouseWheel();         // Обработка клавиш навигации        if (IsKeyPressed(KEY_DOWN) && selected_item < files.count - 1) {            selected_item++;        }         if (IsKeyPressed(KEY_UP) && selected_item > 0) {            selected_item--;        }         if (IsKeyPressed(KEY_PAGE_DOWN)) {          selected_item = (selected_item + MAX_VISIBLE_ITEMS < files.count - 1) ?                selected_item + MAX_VISIBLE_ITEMS : files.count - 1;        }         if (IsKeyPressed(KEY_PAGE_UP)) {          selected_item = (selected_item - MAX_VISIBLE_ITEMS > 0) ?              selected_item - MAX_VISIBLE_ITEMS : 0;        }         // Обработка Enter (открытие файла/директории)        if (IsKeyPressed(KEY_ENTER) && files.count > 0) {            const char *selected = files.items[selected_item];            if (selected[strlen(selected)-1] == '/') {                if (strcmp(selected, "../") == 0) {                    // Переход в родительскую директорию                    char *last_slash = strrchr(current_dir, '/');                    if (last_slash != NULL) {                        *last_slash = '\0';                        if (strlen(current_dir) == 0) strcpy(current_dir, "/");                      LoadDirectory(current_dir);                    }                } else {                    // Переход в поддиректорию                  char new_path[2048];                    snprintf(new_path, sizeof(new_path), "%s/%.*s", current_dir, (int)strlen(selected)-1, selected);                    LoadDirectory(new_path);                }            } else {                // Выбран файл                TraceLog(LOG_INFO, TextFormat("Selected: %s/%s", current_dir, selected));            }        }         // Обработка Backspace (назад)        if (IsKeyPressed(KEY_BACKSPACE)) {            char *last_slash = strrchr(current_dir, '/');            if (last_slash != NULL) {                *last_slash = '\0';                if (strlen(current_dir) == 0) strcpy(current_dir, "/");                LoadDirectory(current_dir);            }        }         // Обновление по F5        if (IsKeyPressed(KEY_F5)) {            LoadDirectory(current_dir);        }         // Отрисовка        BeginDrawing();            ClearBackground(RAYWHITE);            DrawInterface();        EndDrawing();    }     // Освобождение ресурсов    FreeFileList();    UnloadFont(russian_font);    CloseWindow();     return 0;} ---------------------------------------------------------------------- Lulu · 2025-04-07 13:03 Hi Guva, the way you construct the charset is interesting. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   AddRange($C0, $17F);  // Latin-1 Supplement + Latin Extended-A  AddRange($180, $24F); // Latin Extended-B  AddRange($370, $3FF); // Greek and Coptic  AddRange($400, $4FF); // Cyrillic  AddRange($500, $52F); // Cyrillic Supplement  AddRange($1E00, $1EFF); // Latin Extended Additional Thanks for sharing!