Metadata-Version: 2.4
Name: ikkVisualKit
Version: 0.0.1
Summary: Insight.k.k. VisualKit for easy application development
Author-email: "Insight.k.k. Team" <maintainer@insightkk.net>
License-Expression: MIT
Project-URL: Homepage, https://insightkk.net/oss/ikkVisualKit
Project-URL: Documentation, https://insightkk.net/oss/ikkVisualKit/api/index.html
Project-URL: Issues, https://github.com/Insight-kk/ikkVisualKit/issues
Project-URL: Source, https://github.com/Insight-kk/ikkVisualKit
Keywords: gui,tkinter,toolkit,ui,framework
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cantok>=0.0.1
Requires-Dist: asyncio-cancel-token>=0.2.0
Requires-Dist: pystray>=0.19.4
Requires-Dist: Pillow>=9.0
Requires-Dist: keyboard>=0.13.5
Requires-Dist: customtkinter>=5.2.2
Dynamic: license-file

# ikkVisualKit

Pythonアプリケーション開発用の軽量GUIツールキット。tkinterとcustomtkinterをベースに、ウィンドウ、ダイアログ、システムトレイアプリケーション用の汎用コンポーネントを提供します。

## 主な機能

- **ウィンドウベースクラス** - CTkやtkinterベースのウィンドウを簡単に構築
- **ダイアログコンポーネント** - OK、YesNo、カスタムダイアログなど汎用ダイアログ
- **システムトレイ対応** - トレイメニュー、常駐アプリケーション機能
- **画像管理** - パッケージ内の画像リソースを統一的に管理

## インストール

```bash
pip install ikkVisualKit
```

## 使用例

```python
from ikkVisualKit import WindowBaseModan

class MainWindow(WindowBaseModan):
    def __init__(self):
        super().__init__(
            title="My Application",
            version="1.0.0",
            size=(1000, 600)
        )
    
    def _build(self, root):
        super()._build(root)
        # UIパーツの配置

if __name__ == "__main__":
    app = MainWindow()
    app.show_window()
    app.run()
```

## Overview
[ikkVisualKit](https://github.com/Insight-kk/ikkVisualKit/tree/8c55eac18e43b5ea5136d7e2d33febff9a346d79)はGUIアプリ作成用典型的なパーツのToolKitです。

# Feature
* CustomTkinterベース
* DPIスケーリング対応
* フォームアプリの作成が容易になるBaseクラスの提供
* フォームアプリ向けに
* 常駐(タスクトレイ)アプリの作成を用意するテンプレートの提供
* サイズの大きいカスタムメッセージダイアログの提供

# インストール方法
```
pip install ikkVisualKit
````



# 利用方法
```python
from ikkVisualKit import WindowBaseModan    #ファームアプリを作成する場合
from ikkVisualKit import DialogResult       #ダイアログを利用する場合
```


# フォームアプリケーションの作成方法

## フォームの作成
1. `WindowBaseModan`を継承した任意のウインドウクラスを作成します。
1. `def _build(self, root):`をオーバライドして,`super()._build(root)`を実行します。
1. `show_window()`と`run()`を実行するとWindowアプリケーションが起動します。

```python
from ikkVisualKit import WindowBaseModan

class MainWindow(WindowBaseModan):
    def __init__(self):
        super().__init__(
            title="MyApplecation",  #アプリ名
            version="0.0.0",        #バージョン
            size=(1000, 600),       #ウィンドウサイズ
            icon_path="resources/icon.dio.ico", #アイコンパス（.ico推奨）
            tray_app=False          #常駐アプリにしたいならTrue
            )
    #----------------------------------------------
    def _build(self, root):
        super()._build(root)
        #パーツの配置
if __name__ == "__main__":
    app = MainWindow()
    app.show_window()
    app.run()
```


## カスタムボタン
* 大中小３タイプのボタンサイズを用意
* ツールチップテキストをプロパティとして用意
* マウスホバー時の色変更
* ボタンに付与するアイコン画像を予め用意



### 小さいアイコン付きボタン
以下のコードは小さいサイズのアイコン付きボタンを作成する例です。
コンストラクタのx,yに配置する座標を指定し、image_keyで[アイコン](#小さいアイコン付きボタン)を指定してください。
ツールチップテキストと、イベントハンドラを後から登録することが可能です。
```python
self.btnSetting  = self.make_ActionButton(x=16 , y=176, image_key="setting.dio")
self.btnSetting.tooltip_text = "設定を開く"  #ツールチップテキスト設定
self.btnSetting.command = self.on_setting   #ボタン押下で実行する関数の登録
```
![alt text](./doc/image.png)

### 大きいサイズのボタン
大きいサイズのボタンを利用する場合ば`size_rank=1`もしくは`size_rank=2`を指定してください。また、`text=`で指定した文字がアイコンと共に表示されます。
```python
self.btnStart    = self.make_ActionButton(624, 16 , image_key="start.dio",size_rank=2,text="検査スタート")
self.btnClear    = self.make_ActionButton(784, 16 , image_key="clear.dio",size_rank=1,text="クリア")
```



### アイコンの一覧

```python
```

Name      |Image
----------|-------------------------
clear.dio   | ![clear.dio](ikkVisualKit/image/clear.dio.png)
goto.dio    | ![clear.dio](ikkVisualKit/image/goto.dio.png)
help.dio    | ![clear.dio](ikkVisualKit/image/help.dio.png)
link.dio    | ![clear.dio](ikkVisualKit/image/link.dio.png)
lock.dio    | ![clear.dio](ikkVisualKit/image/lock.dio.png)
log.dio     | ![clear.dio](ikkVisualKit/image/log.dio.png)
open.dio    | ![clear.dio](ikkVisualKit/image/open.dio.png)
recipe.dio  | ![clear.dio](ikkVisualKit/image/recipe.dio.png)
save.dio    | ![clear.dio](ikkVisualKit/image/save.dio.png)
search.dio   | ![clear.dio](ikkVisualKit/image/search.dio.png)
setting.dio | ![clear.dio](ikkVisualKit/image/setting.dio.png)
start.dio   | ![clear.dio](ikkVisualKit/image/start.dio.png)
unlock.dio  | ![clear.dio](ikkVisualKit/image/unlock.dio.png)

